Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Ja2/SaveLoadGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions Strategic/strategicmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
8 changes: 6 additions & 2 deletions Tactical/Tactical Save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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<ROTTING_CORPSE_DEFINITION> corpsedefvector;

Expand Down
2 changes: 1 addition & 1 deletion Tactical/Tactical Save.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down