Script: Only log each string parameter warning message once

This commit is contained in:
Jonathan G Rennison
2023-03-27 20:14:49 +01:00
parent ce5c758f2b
commit 29c451d1a8
8 changed files with 38 additions and 4 deletions

View File

@@ -170,12 +170,12 @@ const std::string ScriptText::GetEncodedText()
return buf;
}
void ScriptText::_TextParamError(const std::string &msg)
void ScriptText::_TextParamError(std::string msg)
{
if (this->GetActiveInstance()->IsTextParamMismatchAllowed()) {
ScriptLog::Error(msg.c_str());
ScriptLog::LogOnce(ScriptLog::LOG_ERROR, std::move(msg));
} else {
throw Script_FatalError(msg);
throw Script_FatalError(std::move(msg));
}
}