diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 1db652902..f19001aa7 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.2: +- Check for a deadlock in savedgames and try to continue -PhracturedBlue - Added an option ('-a') to display 'PC-style' course-scan -PhracturedBlue - Fixed deadlock races in new FlushGraphics method -PhracturedBlue - FlushGraphics now waits and notifies on a per-thread level diff --git a/sc2/src/sc2code/load.c b/sc2/src/sc2code/load.c index 20329f3b5..9f42ecedf 100644 --- a/sc2/src/sc2code/load.c +++ b/sc2/src/sc2code/load.c @@ -148,6 +148,12 @@ LoadGame (COUNT which_game, SUMMARY_DESC *summary_desc) GLOBAL (avail_race_q) = avail_q; GLOBAL (npc_built_ship_q) = npc_q; GLOBAL (built_ship_q) = player_q; + // It shouldn't be possible to ever save with TimeCounter != 0 + // But if it does happen, it needs to be reset to 0, since on load + // the clock semaphore is gauranteed to be 0 + if (GLOBAL (GameClock.TimeCounter) != 0) + fprintf (stderr, "Warning: Game clock wasn't stopped during save, Savegame may be corrupt!\n"); + GLOBAL (GameClock.TimeCounter) = 0; LoadShipQueue (fh, &GLOBAL (avail_race_q), FALSE); if (!(NextActivity & START_INTERPLANETARY))