mirror of https://github.com/OpenTTD/OpenTTD
(svn r17537) -Fix: don't crash while printing gamelog in crash handler if we crashed before while gamelog action was active
parent
8deb7efcc7
commit
d6f4cda74e
|
@ -211,9 +211,7 @@ bool CrashLog::WriteSavegame(char *filename, const char *filename_last) const
|
||||||
if (_m == NULL) return false;
|
if (_m == NULL) return false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
GamelogStartAction(GLAT_EMERGENCY);
|
|
||||||
GamelogEmergency();
|
GamelogEmergency();
|
||||||
GamelogStopAction();
|
|
||||||
|
|
||||||
seprintf(filename, filename_last, "%scrash.sav", _personal_dir);
|
seprintf(filename, filename_last, "%scrash.sav", _personal_dir);
|
||||||
|
|
||||||
|
|
|
@ -334,8 +334,11 @@ static LoggedChange *GamelogChange(GamelogChangeType ct)
|
||||||
*/
|
*/
|
||||||
void GamelogEmergency()
|
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);
|
GamelogChange(GLCT_EMERGENCY);
|
||||||
|
GamelogStopAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Finds out if current game is a loaded emergency savegame.
|
/** Finds out if current game is a loaded emergency savegame.
|
||||||
|
|
Loading…
Reference in New Issue