mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Fix: Crash if squirrel compatibility scripts cannot be parsed. (#11589)
This commit is contained in:
parent
7726f8f245
commit
302e8852c1
@ -76,6 +76,10 @@ void ScriptInstance::Initialize(const std::string &main_script, const std::strin
|
|||||||
/* Register the API functions and classes */
|
/* Register the API functions and classes */
|
||||||
this->engine->SetGlobalPointer(this->engine);
|
this->engine->SetGlobalPointer(this->engine);
|
||||||
this->RegisterAPI();
|
this->RegisterAPI();
|
||||||
|
if (this->IsDead()) {
|
||||||
|
/* Failed to register API; a message has already been logged. */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ScriptObject::SetAllowDoCommand(false);
|
ScriptObject::SetAllowDoCommand(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user