diff options
author | Rubidium <rubidium@openttd.org> | 2021-04-17 09:59:18 +0200 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-04-17 22:24:52 +0200 |
commit | 4400bbfa964dd6353f0cf7591f6be6a789039399 (patch) | |
tree | f0b6c699b81c8fa81b0f95948774cea832c12a28 /src/script/script_instance.cpp | |
parent | 3248a6c12b27801d44fbb67b405d204d10672c9f (diff) | |
download | openttd-4400bbfa964dd6353f0cf7591f6be6a789039399.tar.xz |
Change: [Script] Let Script_FatalError use std::string instead of const char *
Diffstat (limited to 'src/script/script_instance.cpp')
-rw-r--r-- | src/script/script_instance.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index 8227060d3..f7f9de4fc 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -100,7 +100,7 @@ void ScriptInstance::Initialize(const char *main_script, const char *instance_na ScriptObject::SetAllowDoCommand(true); } catch (Script_FatalError &e) { this->is_dead = true; - this->engine->ThrowError(e.GetErrorMessage()); + this->engine->ThrowError(e.GetErrorMessage().c_str()); this->engine->ResumeError(); this->Died(); } @@ -228,7 +228,7 @@ void ScriptInstance::GameLoop() this->callback = e.GetSuspendCallback(); } catch (Script_FatalError &e) { this->is_dead = true; - this->engine->ThrowError(e.GetErrorMessage()); + this->engine->ThrowError(e.GetErrorMessage().c_str()); this->engine->ResumeError(); this->Died(); } @@ -249,7 +249,7 @@ void ScriptInstance::GameLoop() this->callback = e.GetSuspendCallback(); } catch (Script_FatalError &e) { this->is_dead = true; - this->engine->ThrowError(e.GetErrorMessage()); + this->engine->ThrowError(e.GetErrorMessage().c_str()); this->engine->ResumeError(); this->Died(); } @@ -505,7 +505,7 @@ void ScriptInstance::Save() /* If we don't mark the script as dead here cleaning up the squirrel * stack could throw Script_FatalError again. */ this->is_dead = true; - this->engine->ThrowError(e.GetErrorMessage()); + this->engine->ThrowError(e.GetErrorMessage().c_str()); this->engine->ResumeError(); SaveEmpty(); /* We can't kill the script here, so mark it as crashed (not dead) and |