diff --git a/Ja2/SaveLoadGame.cpp b/Ja2/SaveLoadGame.cpp index 503fb74ef..c43b3cc92 100644 --- a/Ja2/SaveLoadGame.cpp +++ b/Ja2/SaveLoadGame.cpp @@ -3587,7 +3587,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc ) DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("starting SaveCurrentSectorsInformationToTempItemFile" ) ); //Save the current sectors open temp files to the disk - if( !SaveCurrentSectorsInformationToTempItemFile() ) + if( !SaveCurrentSectorsInformationToTempItemFile( TRUE ) ) { ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR in SaveCurrentSectorsInformationToTempItemFile()"); goto FAILED_TO_SAVE; diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index 2779929c8..71a5a4e9c 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -6476,7 +6476,7 @@ BOOLEAN HandleDefiniteUnloadingOfWorld( UINT8 ubUnloadCode ) TeamDropAll( MILITIA_TEAM ); // Save the current sectors Item list to a temporary file, if its not the first time in - SaveCurrentSectorsInformationToTempItemFile( ); + SaveCurrentSectorsInformationToTempItemFile( FALSE ); // Update any mercs currently in sector, their profile info... UpdateSoldierPointerDataIntoProfile( FALSE ); @@ -6492,7 +6492,7 @@ BOOLEAN HandleDefiniteUnloadingOfWorld( UINT8 ubUnloadCode ) } //Save the current sectors open temp files to the disk - if ( !SaveCurrentSectorsInformationToTempItemFile( ) ) + if ( !SaveCurrentSectorsInformationToTempItemFile( FALSE ) ) { ScreenMsg( FONT_MCOLOR_WHITE, MSG_TESTVERSION, L"ERROR in SaveCurrentSectorsInformationToTempItemFile()" ); return FALSE; @@ -6639,7 +6639,7 @@ BOOLEAN CheckAndHandleUnloadingOfCurrentWorld( ) TeamDropAll( MILITIA_TEAM, TRUE ); // Save the current sectors Item list to a temporary file, if its not the first time in - SaveCurrentSectorsInformationToTempItemFile( ); + SaveCurrentSectorsInformationToTempItemFile( FALSE ); return FALSE; } diff --git a/Tactical/Tactical Save.cpp b/Tactical/Tactical Save.cpp index 015339de3..3c5fd3551 100644 --- a/Tactical/Tactical Save.cpp +++ b/Tactical/Tactical Save.cpp @@ -993,7 +993,7 @@ BOOLEAN AddItemsToUnLoadedSector(INT16 sMapX, INT16 sMapY, INT8 bMapZ, INT32 sGr extern BOOLEAN gfInMeanwhile; extern BOOLEAN EnableModifiedFileSetCache(BOOLEAN value); -BOOLEAN SaveCurrentSectorsInformationToTempItemFile( ) +BOOLEAN SaveCurrentSectorsInformationToTempItemFile(BOOLEAN saveGame) { BOOLEAN fShouldBeInMeanwhile = FALSE; if( gfWasInMeanwhile ) @@ -1027,7 +1027,11 @@ BOOLEAN SaveCurrentSectorsInformationToTempItemFile( ) // handle all reachable before save HandleAllReachAbleItemsInTheSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); UpdateWorldItems(gWorldSectorX, gWorldSectorY, gbWorldSectorZ, guiNumWorldItems, gWorldItems); - PruneWorldItems(); + + if (saveGame) + { + PruneWorldItems(); + } std::vector corpsedefvector; diff --git a/Tactical/Tactical Save.h b/Tactical/Tactical Save.h index 0dfafcfd1..f4cb4f3ae 100644 --- a/Tactical/Tactical Save.h +++ b/Tactical/Tactical Save.h @@ -44,7 +44,7 @@ BOOLEAN GetNumberOfWorldItemsFromTempItemFile( INT16 sMapX, INT16 sMapY, INT8 bM UINT32 GetNumberOfMovableItems( INT16 sMapX, INT16 sMapY, INT8 bMapZ ); //Saves the Current Sectors, ( world Items, rotting corpses, ... ) to the temporary file used to store the sectors items -BOOLEAN SaveCurrentSectorsInformationToTempItemFile( ); +BOOLEAN SaveCurrentSectorsInformationToTempItemFile( BOOLEAN saveGame ); //Loads the Currents Sectors information ( world Items, rotting corpses, ... ) from the temporary file used to store the sectores items BOOLEAN LoadCurrentSectorsInformationFromTempItemsFile();