Codechange: use std::string for script log calls

This commit is contained in:
Rubidium
2023-05-05 19:32:27 +02:00
committed by rubidium42
parent 77177f7e8b
commit b24a6bb8f3
4 changed files with 14 additions and 17 deletions

View File

@@ -45,15 +45,13 @@
throw Script_Suspend(ticks, nullptr);
}
/* static */ void ScriptController::Break(const char* message)
/* static */ void ScriptController::Break(const std::string &message)
{
if (_network_dedicated || !_settings_client.gui.ai_developer_tools) return;
ScriptObject::GetActiveInstance()->Pause();
char log_message[1024];
seprintf(log_message, lastof(log_message), "Break: %s", message);
ScriptLog::Log(ScriptLogTypes::LOG_SQ_ERROR, log_message);
ScriptLog::Log(ScriptLogTypes::LOG_SQ_ERROR, fmt::format("Break: {}", message));
/* Inform script developer that their script has been paused and
* needs manual action to continue. */
@@ -64,7 +62,7 @@
}
}
/* static */ void ScriptController::Print(bool error_msg, const char *message)
/* static */ void ScriptController::Print(bool error_msg, const std::string &message)
{
ScriptLog::Log(error_msg ? ScriptLogTypes::LOG_SQ_ERROR : ScriptLogTypes::LOG_SQ_INFO, message);
}