Browse Source

server: fix some int <> unsigned int conversions

pull/2/head
Alibek Omarov 4 years ago
parent
commit
585ae28dd2
  1. 2
      engine/server/server.h
  2. 8
      engine/server/sv_game.c
  3. 6
      engine/server/sv_save.c

2
engine/server/server.h

@ -615,7 +615,7 @@ void SV_EmptyStringPool( void );
void SV_PrintStr64Stats_f( void ); void SV_PrintStr64Stats_f( void );
#endif #endif
sv_client_t *SV_ClientFromEdict( const edict_t *pEdict, qboolean spawned_only ); sv_client_t *SV_ClientFromEdict( const edict_t *pEdict, qboolean spawned_only );
int SV_MapIsValid( const char *filename, const char *spawn_entity, const char *landmark_name ); uint SV_MapIsValid( const char *filename, const char *spawn_entity, const char *landmark_name );
void SV_StartSound( edict_t *ent, int chan, const char *sample, float vol, float attn, int flags, int pitch ); void SV_StartSound( edict_t *ent, int chan, const char *sample, float vol, float attn, int flags, int pitch );
edict_t *SV_FindGlobalEntity( string_t classname, string_t globalname ); edict_t *SV_FindGlobalEntity( string_t classname, string_t globalname );
qboolean SV_CreateStaticEntity( struct sizebuf_s *msg, int index ); qboolean SV_CreateStaticEntity( struct sizebuf_s *msg, int index );

8
engine/server/sv_game.c

@ -681,7 +681,7 @@ Issue changing level
*/ */
void SV_QueueChangeLevel( const char *level, const char *landname ) void SV_QueueChangeLevel( const char *level, const char *landname )
{ {
int flags, smooth = false; uint flags, smooth = false;
char mapname[MAX_QPATH]; char mapname[MAX_QPATH];
char *spawn_entity; char *spawn_entity;
@ -880,9 +880,9 @@ SV_MapIsValid
Validate map Validate map
============== ==============
*/ */
int SV_MapIsValid( const char *filename, const char *spawn_entity, const char *landmark_name ) uint SV_MapIsValid( const char *filename, const char *spawn_entity, const char *landmark_name )
{ {
int flags = 0; uint flags = 0;
char *pfile; char *pfile;
char *ents; char *ents;
@ -3679,7 +3679,7 @@ vaild map must contain one info_player_deatchmatch
*/ */
int GAME_EXPORT pfnIsMapValid( char *filename ) int GAME_EXPORT pfnIsMapValid( char *filename )
{ {
int flags = SV_MapIsValid( filename, GI->mp_entity, NULL ); uint flags = SV_MapIsValid( filename, GI->mp_entity, NULL );
if( FBitSet( flags, MAP_IS_EXIST ) && FBitSet( flags, MAP_HAS_SPAWNPOINT )) if( FBitSet( flags, MAP_IS_EXIST ) && FBitSet( flags, MAP_HAS_SPAWNPOINT ))
return true; return true;

6
engine/server/sv_save.c

@ -2096,7 +2096,7 @@ qboolean SV_LoadGame( const char *pPath )
qboolean validload = false; qboolean validload = false;
GAME_HEADER gameHeader; GAME_HEADER gameHeader;
file_t *pFile; file_t *pFile;
int flags; uint flags;
if( Host_IsDedicated() ) if( Host_IsDedicated() )
return false; return false;
@ -2289,7 +2289,7 @@ int GAME_EXPORT SV_GetSaveComment( const char *savename, char *comment )
if( tag == 0x0065 ) if( tag == 0x0065 )
{ {
Q_strncpy( comment, "old version Xash3D <unsupported>", MAX_STRING ); Q_strncpy( comment, "<old version Xash3D unsupported>", MAX_STRING );
FS_Close( f ); FS_Close( f );
return 0; return 0;
} }
@ -2409,7 +2409,7 @@ int GAME_EXPORT SV_GetSaveComment( const char *savename, char *comment )
time_t fileTime; time_t fileTime;
const struct tm *file_tm; const struct tm *file_tm;
string timestring; string timestring;
int flags; uint flags;
// now check for map problems // now check for map problems
flags = SV_MapIsValid( mapName, GI->sp_entity, NULL ); flags = SV_MapIsValid( mapName, GI->sp_entity, NULL );

Loading…
Cancel
Save