mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-02 09:40:35 +00:00
(svn r17537) -Fix: don't crash while printing gamelog in crash handler if we crashed before while gamelog action was active
This commit is contained in:
parent
8deb7efcc7
commit
d6f4cda74e
@ -211,9 +211,7 @@ bool CrashLog::WriteSavegame(char *filename, const char *filename_last) const
|
||||
if (_m == NULL) return false;
|
||||
|
||||
try {
|
||||
GamelogStartAction(GLAT_EMERGENCY);
|
||||
GamelogEmergency();
|
||||
GamelogStopAction();
|
||||
|
||||
seprintf(filename, filename_last, "%scrash.sav", _personal_dir);
|
||||
|
||||
|
@ -334,8 +334,11 @@ static LoggedChange *GamelogChange(GamelogChangeType ct)
|
||||
*/
|
||||
void GamelogEmergency()
|
||||
{
|
||||
assert(_gamelog_action_type == GLAT_EMERGENCY);
|
||||
/* Terminate any active action */
|
||||
if (_gamelog_action_type != GLAT_NONE) GamelogStopAction();
|
||||
GamelogStartAction(GLAT_EMERGENCY);
|
||||
GamelogChange(GLCT_EMERGENCY);
|
||||
GamelogStopAction();
|
||||
}
|
||||
|
||||
/** Finds out if current game is a loaded emergency savegame.
|
||||
|
Loading…
Reference in New Issue
Block a user