mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-06 19:01:04 +03:00
Prevent clearing the event command list if the event system is not initialized
This fixes the issue where the game could crash (especially in optimized release) due to a memory corruption, because the event command list was deconstructed earlier
This commit is contained in:
parent
ddbdcc91dd
commit
581585a47c
2 changed files with 13 additions and 0 deletions
|
@ -533,6 +533,13 @@ void ScriptMaster::InitConstStrings(void)
|
|||
AddString(ConstStrings[i]);
|
||||
}
|
||||
|
||||
if (!Listener::EventSystemStarted) {
|
||||
// Added in OPM
|
||||
// This usually means the game module is getting destroyed
|
||||
// most often, the event command list has been destroyed earlier
|
||||
return;
|
||||
}
|
||||
|
||||
Event::normalCommandList.clear();
|
||||
Event::returnCommandList.clear();
|
||||
Event::getterCommandList.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue