From ad23012567154805cc5d635ea3aaed95fc59c5ab Mon Sep 17 00:00:00 2001 From: avolkov Date: Sat, 4 Jul 2009 07:25:58 +0000 Subject: [PATCH] Fixed crashes and potential weirdness when loading savegames from a Homeworld encounter screen git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3169 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 2 ++ sc2/src/sc2code/planets/solarsys.c | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 32b1e4877..302b8f756 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,6 @@ Changes towards version 0.7: +- Fixed crashes and potential weirdness when loading savegames from + a Homeworld encounter screen - Alex - Cleanup of GLOBAL(ShipStamp.frame) abuse; fixes bug #1054 - Alex - Game attempts to exit cleanly under normal circustances (bug #52) - Alex - Fixed Mmrnmhrm's X-Form transformation without energy use (bug #1004) - Alex diff --git a/sc2/src/sc2code/planets/solarsys.c b/sc2/src/sc2code/planets/solarsys.c index 9b41007a1..c0743496c 100644 --- a/sc2/src/sc2code/planets/solarsys.c +++ b/sc2/src/sc2code/planets/solarsys.c @@ -1531,9 +1531,13 @@ UninitSolarSys (void) if (GLOBAL (CurrentActivity) & END_INTERPLANETARY) { GLOBAL (CurrentActivity) &= ~END_INTERPLANETARY; - (*pSolarSysState->GenFunc) (UNINIT_NPCS); - - SET_GAME_STATE (USED_BROADCASTER, 0); + + if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD))) + { // These are game state changing ops and so cannot be + // called once another game has been loaded! + (*pSolarSysState->GenFunc) (UNINIT_NPCS); + SET_GAME_STATE (USED_BROADCASTER, 0); + } } else if ((GLOBAL (CurrentActivity) & START_ENCOUNTER) && EncounterGroup) {