mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-12 05:26:48 +03:00
Added and using SAVEGAME_STRUCT_VERSION
This commit is contained in:
parent
0e9d83ee14
commit
cca37e3dfe
2 changed files with 6 additions and 4 deletions
|
@ -1453,6 +1453,8 @@ typedef struct {
|
|||
// trace->entityNum can also be 0 to (MAX_GENTITIES-1)
|
||||
// or ENTITYNUM_NONE, ENTITYNUM_WORLD
|
||||
|
||||
#define SAVEGAME_STRUCT_VERSION 4
|
||||
|
||||
typedef struct {
|
||||
int version;
|
||||
int time;
|
||||
|
|
|
@ -1884,7 +1884,7 @@ qboolean SV_ArchiveLevelFile(qboolean loading, qboolean autosave)
|
|||
if (f)
|
||||
{
|
||||
FS_Read(&save, sizeof(savegamestruct_t), f);
|
||||
if (save.version != 4)
|
||||
if (save.version != SAVEGAME_STRUCT_VERSION)
|
||||
{
|
||||
FS_FCloseFile(f);
|
||||
return qfalse;
|
||||
|
@ -1986,7 +1986,7 @@ qboolean SV_ArchiveServerFile( qboolean loading, qboolean autosave )
|
|||
|
||||
SV_SetConfigstring( CS_SAVENAME, "" );
|
||||
|
||||
save.version = 3;
|
||||
save.version = SAVEGAME_STRUCT_VERSION;
|
||||
save.time = aclock;
|
||||
strncpy( save.mapName, svs.mapName, sizeof( save.mapName ) );
|
||||
strncpy( save.saveName, svs.gameName, sizeof( save.saveName ) );
|
||||
|
@ -2011,7 +2011,7 @@ qboolean SV_ArchiveServerFile( qboolean loading, qboolean autosave )
|
|||
}
|
||||
|
||||
FS_Read(&save, sizeof(savegamestruct_t), f);
|
||||
if( save.version != 3 )
|
||||
if (save.version != SAVEGAME_STRUCT_VERSION)
|
||||
{
|
||||
Com_Printf("Invalid or Old Server SaveGame Version\n");
|
||||
return qfalse;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue