TemplePlus
TemplePlus copied to clipboard
Crash when closing game while in combat
When the game is closed while in combat, the game crashes in combat_exit.
Apparently the initiative list is never cleaned up when the map is closed and as such it still contains handles for objects that have already been deallocated.
Crash does not happen when quitting to main menu during combat, and then closing the game.
This is related to the order of shutdown for game systems. Vanilla map_close accesses game systems that have already been closed during shutdown. In our case, this causes a crash because the game system has been deleted completely. In vanilla, this worked, since everything is just a static function.