|
|
@ -1693,7 +1693,7 @@ SaveGameSlot |
|
|
|
do a save game |
|
|
|
do a save game |
|
|
|
============= |
|
|
|
============= |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static int SaveGameSlot( const char *pSaveName, const char *pSaveComment ) |
|
|
|
static qboolean SaveGameSlot( const char *pSaveName, const char *pSaveComment ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char hlPath[MAX_QPATH]; |
|
|
|
char hlPath[MAX_QPATH]; |
|
|
|
char name[MAX_QPATH]; |
|
|
|
char name[MAX_QPATH]; |
|
|
@ -1704,7 +1704,7 @@ static int SaveGameSlot( const char *pSaveName, const char *pSaveComment ) |
|
|
|
file_t *pFile; |
|
|
|
file_t *pFile; |
|
|
|
|
|
|
|
|
|
|
|
pSaveData = SaveGameState( false ); |
|
|
|
pSaveData = SaveGameState( false ); |
|
|
|
if( !pSaveData ) return 0; |
|
|
|
if( !pSaveData ) return false; |
|
|
|
|
|
|
|
|
|
|
|
SaveFinish( pSaveData ); |
|
|
|
SaveFinish( pSaveData ); |
|
|
|
pSaveData = SaveInit( SAVE_HEAPSIZE, SAVE_HASHSTRINGS ); // re-init the buffer
|
|
|
|
pSaveData = SaveInit( SAVE_HEAPSIZE, SAVE_HASHSTRINGS ); // re-init the buffer
|
|
|
@ -1735,7 +1735,7 @@ static int SaveGameSlot( const char *pSaveName, const char *pSaveComment ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// something bad is happens
|
|
|
|
// something bad is happens
|
|
|
|
SaveFinish( pSaveData ); |
|
|
|
SaveFinish( pSaveData ); |
|
|
|
return 0; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// pending the preview image for savegame
|
|
|
|
// pending the preview image for savegame
|
|
|
@ -1759,7 +1759,7 @@ static int SaveGameSlot( const char *pSaveName, const char *pSaveComment ) |
|
|
|
SaveFinish( pSaveData ); |
|
|
|
SaveFinish( pSaveData ); |
|
|
|
FS_Close( pFile ); |
|
|
|
FS_Close( pFile ); |
|
|
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -2169,17 +2169,17 @@ qboolean SV_LoadGame( const char *pPath ) |
|
|
|
SV_SaveGame |
|
|
|
SV_SaveGame |
|
|
|
================== |
|
|
|
================== |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void SV_SaveGame( const char *pName ) |
|
|
|
qboolean SV_SaveGame( const char *pName ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char comment[80]; |
|
|
|
char comment[80]; |
|
|
|
int result; |
|
|
|
|
|
|
|
string savename; |
|
|
|
string savename; |
|
|
|
|
|
|
|
|
|
|
|
if( !COM_CheckString( pName )) |
|
|
|
if( !COM_CheckString( pName )) |
|
|
|
return; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
// can we save at this point?
|
|
|
|
// can we save at this point?
|
|
|
|
if( !IsValidSave( )) return; |
|
|
|
if( !IsValidSave( )) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
if( !Q_stricmp( pName, "new" )) |
|
|
|
if( !Q_stricmp( pName, "new" )) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -2197,7 +2197,7 @@ void SV_SaveGame( const char *pName ) |
|
|
|
if( n == 1000 ) |
|
|
|
if( n == 1000 ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Printf( S_ERROR "no free slots for savegame\n" ); |
|
|
|
Con_Printf( S_ERROR "no free slots for savegame\n" ); |
|
|
|
return; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else Q_strncpy( savename, pName, sizeof( savename )); |
|
|
|
else Q_strncpy( savename, pName, sizeof( savename )); |
|
|
@ -2208,12 +2208,7 @@ void SV_SaveGame( const char *pName ) |
|
|
|
#endif // XASH_DEDICATED
|
|
|
|
#endif // XASH_DEDICATED
|
|
|
|
|
|
|
|
|
|
|
|
SaveBuildComment( comment, sizeof( comment )); |
|
|
|
SaveBuildComment( comment, sizeof( comment )); |
|
|
|
result = SaveGameSlot( savename, comment ); |
|
|
|
return SaveGameSlot( savename, comment ); |
|
|
|
|
|
|
|
|
|
|
|
#if !XASH_DEDICATED |
|
|
|
|
|
|
|
if( result && !FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE )) |
|
|
|
|
|
|
|
CL_HudMessage( "GAMESAVED" ); // defined in titles.txt
|
|
|
|
|
|
|
|
#endif // XASH_DEDICATED
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|