Vehicle data is no longer saved and loaded into savegames, as it was externalised to xml a long time ago

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6093 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-05-24 14:25:47 +00:00
parent 42e8c48cac
commit 2bf92c7301
4 changed files with 11 additions and 36 deletions
+2 -1
View File
@@ -21,6 +21,7 @@ extern CHAR16 zTrackingNumber[16];
// Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file
#define NO_VEHICLE_SAVE 144 // Flugente: vehicle data isn't saved anymore, as it has long been externalised
#define SOLDIER_PROFILES 143 // Flugente: profiles for enemy and militia (possibly any non-NPC/RPC character)
#define DYNAMIC_FLASHLIGHTS 142 // Flugente: had to add variables to LIGHTEFFECT-struct
#define ENLARGED_OPINIONS 141 // Flugente: increased numberof merc opinions to 255, thus need to change savegame reading
@@ -62,7 +63,7 @@ extern CHAR16 zTrackingNumber[16];
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
#define SAVE_GAME_VERSION SOLDIER_PROFILES
#define SAVE_GAME_VERSION NO_VEHICLE_SAVE
//#define RUSSIANGOLD
#ifdef __cplusplus
+2 -17
View File
@@ -3886,22 +3886,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
#ifdef JA2BETAVERSION
SaveGameFilePosition( FileGetPos( hFile ), "Lua global" );
#endif
//New vehicles by Jazz
if( !SaveNewVehiclesToSaveGameFile( hFile ) )
{
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing new vehicles");
goto FAILED_TO_SAVE;
#ifdef JA2BETAVERSION
SaveGameFilePosition( FileGetPos( hFile ), "New Vehicles" );
#endif
}
if( !SaveDataSaveToSaveGameFile( hFile ) )
{
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing save data");
@@ -5444,7 +5429,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
LoadGameFilePosition( FileGetPos( hFile ), "Lua Global System" );
#endif
if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE)
if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE && guiCurrentSaveGameVersion < NO_VEHICLE_SAVE)
{
uiRelEndPerc += 1;
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Load New Vehicles..." );
+7 -17
View File
@@ -55,7 +55,8 @@ extern INT8 SquadMovementGroups[ ];
NEW_CAR gNewVehicle[NUM_PROFILES];
BOOLEAN SaveNewVehiclesToSaveGameFile( HWFILE hFile );
// Flugente 2013-05-12: saving and loading an array that is read from xml is utterly pointless. The loading function has to remain for compatibility reasons - please remove the next time savegame compatibility is broken
BOOLEAN LoadNewVehiclesToSaveGameFile( HWFILE hFile );
//ATE: These arrays below should all be in a large LUT which contains
@@ -182,26 +183,15 @@ void SetDriver( INT32 iID, UINT8 ubID );
void TeleportVehicleToItsClosestSector( INT32 iVehicleId, UINT8 ubGroupID );
BOOLEAN SaveNewVehiclesToSaveGameFile( HWFILE hFile )
{
UINT32 uiNumBytesWritten;
FileWrite( hFile, &gNewVehicle, sizeof( gNewVehicle), &uiNumBytesWritten );
if( uiNumBytesWritten != sizeof( gNewVehicle ) )
{
return( FALSE );
}
return( TRUE );
}
// Flugente 2013-05-12: saving and loading an array that is read from xml is utterly pointless. The loading function has to remain for compatibility reasons - please remove the next time savegame compatibility is broken
BOOLEAN LoadNewVehiclesToSaveGameFile( HWFILE hFile )
{
UINT32 uiNumBytesRead;
FileRead( hFile, &gNewVehicle, sizeof( gNewVehicle), &uiNumBytesRead );
if( uiNumBytesRead != sizeof( gNewVehicle ) )
NEW_CAR tmp[NUM_PROFILES];
FileRead( hFile, &tmp, sizeof( tmp), &uiNumBytesRead );
if( uiNumBytesRead != sizeof( tmp ) )
{
return( FALSE );
}
-1
View File
@@ -35,7 +35,6 @@ typedef struct
extern NEW_CAR gNewVehicle[NUM_PROFILES];
extern BOOLEAN SaveNewVehiclesToSaveGameFile( HWFILE hFile );
extern BOOLEAN LoadNewVehiclesToSaveGameFile( HWFILE hFile );
// type of vehicles