diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index 14cc0815..d01faa02 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -6133,11 +6133,11 @@ BOOLEAN HandleDefiniteUnloadingOfWorld( UINT8 ubUnloadCode ) else if( ubUnloadCode == ABOUT_TO_TRASH_WORLD ) { //if we arent loading a saved game - if( !(gTacticalStatus.uiFlags & LOADING_SAVED_GAME ) ) + /*if( !(gTacticalStatus.uiFlags & LOADING_SAVED_GAME ) ) { // Flugente: cause all militia whose equipment is from this sector to drop it TeamDropAll( MILITIA_TEAM ); - } + }*/ //Save the current sectors open temp files to the disk if( !SaveCurrentSectorsInformationToTempItemFile() ) @@ -6274,8 +6274,14 @@ BOOLEAN CheckAndHandleUnloadingOfCurrentWorld() // Added logic to prevent a crash when player mercs would retreat from a battle involving militia and enemies. // Without the return here, it would proceed to trash the world, and then when autoresolve would come up to // finish the tactical battle, it would fail to find the existing soldier information (because it was trashed). - if( HandlePotentialBringUpAutoresolveToFinishBattle( sBattleSectorX, sBattleSectorY, sBattleSectorZ ) ) + if( HandlePotentialBringUpAutoresolveToFinishBattle( sBattleSectorX, sBattleSectorY, sBattleSectorZ ) ) { + // Flugente: cause all militia whose equipment is from this sector to drop it - otherwise it can get lost + TeamDropAll( MILITIA_TEAM, TRUE ); + + // Save the current sectors Item list to a temporary file, if its not the first time in + SaveCurrentSectorsInformationToTempItemFile(); + return FALSE; } //end diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 763eb158..6c4037bf 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -10291,15 +10291,16 @@ void HandleSurrenderOffer( SOLDIERTYPE* pSoldier ) DoMessageBox( MSG_BOX_BASIC_MEDIUM_BUTTONS, TacticalStr[ PRISONER_OFFER_SURRENDER ], guiCurrentScreen, MSG_BOX_FLAG_GENERIC_FOUR_BUTTONS, PrisonerSurrenderMessageBoxCallBack, NULL ); } -void TeamDropAll(UINT8 bTeam) +void TeamDropAll(UINT8 bTeam, BOOLEAN fForce) { if ( bTeam > PLAYER_PLAN ) return; - // not if there is a battle going on, or this team is hostile to us - if ( (gTacticalStatus.uiFlags & INCOMBAT ) ) + // not if there is a battle going on + if ( (gTacticalStatus.uiFlags & INCOMBAT ) && !fForce ) return; + // not if this team is hostile to us if ( gTacticalStatus.Team[ gbPlayerNum ].bSide != gTacticalStatus.Team[ bTeam ].bSide ) return; diff --git a/Tactical/Overhead.h b/Tactical/Overhead.h index 7a9e8cd6..08429c28 100644 --- a/Tactical/Overhead.h +++ b/Tactical/Overhead.h @@ -408,6 +408,7 @@ STR16 GetNewTraitStr(UINT8 aTrait); // Flugente: deal with the insane new trait void HandleSurrenderOffer( SOLDIERTYPE* pSoldier ); // Flugente: offer the enemy the chance to surrender -void TeamDropAll(UINT8 bTeam); +// setting fForce to TRUE allows dropping of gear in combat (used in auto-resolve instances) +void TeamDropAll(UINT8 bTeam, BOOLEAN fForce = FALSE); #endif \ No newline at end of file