mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
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:
+2
-1
@@ -21,6 +21,7 @@ extern CHAR16 zTrackingNumber[16];
|
|||||||
// Keeps track of the saved game version. Increment the saved game version whenever
|
// Keeps track of the saved game version. Increment the saved game version whenever
|
||||||
// you will invalidate the saved game file
|
// 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 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 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
|
#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 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 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
|
//#define RUSSIANGOLD
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
+2
-17
@@ -3886,22 +3886,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
SaveGameFilePosition( FileGetPos( hFile ), "Lua global" );
|
SaveGameFilePosition( FileGetPos( hFile ), "Lua global" );
|
||||||
#endif
|
#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 ) )
|
if( !SaveDataSaveToSaveGameFile( hFile ) )
|
||||||
{
|
{
|
||||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing save data");
|
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" );
|
LoadGameFilePosition( FileGetPos( hFile ), "Lua Global System" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE)
|
if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE && guiCurrentSaveGameVersion < NO_VEHICLE_SAVE)
|
||||||
{
|
{
|
||||||
uiRelEndPerc += 1;
|
uiRelEndPerc += 1;
|
||||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Load New Vehicles..." );
|
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Load New Vehicles..." );
|
||||||
|
|||||||
+7
-17
@@ -55,7 +55,8 @@ extern INT8 SquadMovementGroups[ ];
|
|||||||
|
|
||||||
|
|
||||||
NEW_CAR gNewVehicle[NUM_PROFILES];
|
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 );
|
BOOLEAN LoadNewVehiclesToSaveGameFile( HWFILE hFile );
|
||||||
|
|
||||||
//ATE: These arrays below should all be in a large LUT which contains
|
//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 );
|
void TeleportVehicleToItsClosestSector( INT32 iVehicleId, UINT8 ubGroupID );
|
||||||
|
|
||||||
|
// 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 SaveNewVehiclesToSaveGameFile( HWFILE hFile )
|
|
||||||
{
|
|
||||||
UINT32 uiNumBytesWritten;
|
|
||||||
|
|
||||||
FileWrite( hFile, &gNewVehicle, sizeof( gNewVehicle), &uiNumBytesWritten );
|
|
||||||
if( uiNumBytesWritten != sizeof( gNewVehicle ) )
|
|
||||||
{
|
|
||||||
return( FALSE );
|
|
||||||
}
|
|
||||||
|
|
||||||
return( TRUE );
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOLEAN LoadNewVehiclesToSaveGameFile( HWFILE hFile )
|
BOOLEAN LoadNewVehiclesToSaveGameFile( HWFILE hFile )
|
||||||
{
|
{
|
||||||
UINT32 uiNumBytesRead;
|
UINT32 uiNumBytesRead;
|
||||||
|
|
||||||
FileRead( hFile, &gNewVehicle, sizeof( gNewVehicle), &uiNumBytesRead );
|
NEW_CAR tmp[NUM_PROFILES];
|
||||||
if( uiNumBytesRead != sizeof( gNewVehicle ) )
|
|
||||||
|
FileRead( hFile, &tmp, sizeof( tmp), &uiNumBytesRead );
|
||||||
|
if( uiNumBytesRead != sizeof( tmp ) )
|
||||||
{
|
{
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ typedef struct
|
|||||||
|
|
||||||
extern NEW_CAR gNewVehicle[NUM_PROFILES];
|
extern NEW_CAR gNewVehicle[NUM_PROFILES];
|
||||||
|
|
||||||
extern BOOLEAN SaveNewVehiclesToSaveGameFile( HWFILE hFile );
|
|
||||||
extern BOOLEAN LoadNewVehiclesToSaveGameFile( HWFILE hFile );
|
extern BOOLEAN LoadNewVehiclesToSaveGameFile( HWFILE hFile );
|
||||||
|
|
||||||
// type of vehicles
|
// type of vehicles
|
||||||
|
|||||||
Reference in New Issue
Block a user