mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-10 22:22:10 +08:00
Remove useless host.type set, replace HOST_DEDICATED checks by Host_IsDedicated
This commit is contained in:
@@ -2036,7 +2036,7 @@ void SV_TSourceEngineQuery( netadr_t from )
|
||||
MSG_WriteByte( &buf, count );
|
||||
MSG_WriteByte( &buf, svs.maxclients );
|
||||
MSG_WriteByte( &buf, PROTOCOL_VERSION );
|
||||
MSG_WriteByte( &buf, host.type == HOST_DEDICATED ? 'D' : 'L' );
|
||||
MSG_WriteByte( &buf, Host_IsDedicated() ? 'D' : 'L' );
|
||||
MSG_WriteByte( &buf, 'W' );
|
||||
|
||||
if( Q_stricmp( GI->gamefolder, "valve" ))
|
||||
|
||||
@@ -3393,7 +3393,7 @@ pfnIsDedicatedServer
|
||||
*/
|
||||
int pfnIsDedicatedServer( void )
|
||||
{
|
||||
return (host.type == HOST_DEDICATED);
|
||||
return Host_IsDedicated();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -568,7 +568,7 @@ void SV_ActivateServer( int runPhysics )
|
||||
Log_Printf( "Started map \"%s\" (CRC \"%u\")\n", sv.name, sv.worldmapCRC );
|
||||
|
||||
// dedicated server purge unused resources here
|
||||
if( host.type == HOST_DEDICATED )
|
||||
if( Host_IsDedicated() )
|
||||
Mod_FreeUnused ();
|
||||
|
||||
host.movevars_changed = true;
|
||||
@@ -709,7 +709,7 @@ void SV_SetupClients( void )
|
||||
svs.maxclients = (int)sv_maxclients->value;
|
||||
|
||||
// dedicated servers are can't be single player and are usually DM
|
||||
if( host.type == HOST_DEDICATED )
|
||||
if( Host_IsDedicated() )
|
||||
svs.maxclients = bound( 4, svs.maxclients, MAX_CLIENTS );
|
||||
else svs.maxclients = bound( 1, svs.maxclients, MAX_CLIENTS );
|
||||
|
||||
|
||||
@@ -532,7 +532,7 @@ qboolean SV_IsSimulating( void )
|
||||
if( !SV_HasActivePlayers( ))
|
||||
return false;
|
||||
|
||||
if( host.type == HOST_DEDICATED )
|
||||
if( Host_IsDedicated() )
|
||||
return true; // always active for dedicated servers
|
||||
|
||||
// allow to freeze everything in singleplayer
|
||||
@@ -735,7 +735,7 @@ void SV_AddToMaster( netadr_t from, sizebuf_t *msg )
|
||||
Info_SetValueForKey( s, "bots", va( "%d", bots ), len ); // bot count
|
||||
Info_SetValueForKey( s, "gamedir", GI->gamefolder, len ); // gamedir
|
||||
Info_SetValueForKey( s, "map", sv.name, len ); // current map
|
||||
Info_SetValueForKey( s, "type", (host.type == HOST_DEDICATED) ? "d" : "l", len ); // dedicated or local
|
||||
Info_SetValueForKey( s, "type", (Host_IsDedicated()) ? "d" : "l", len ); // dedicated or local
|
||||
Info_SetValueForKey( s, "password", "0", len ); // is password set
|
||||
Info_SetValueForKey( s, "os", "w", len ); // Windows
|
||||
Info_SetValueForKey( s, "secure", "0", len ); // server anti-cheat
|
||||
|
||||
@@ -514,7 +514,7 @@ static void pfnPlaybackEventFull( int flags, int clientindex, word eventindex, f
|
||||
ent = EDICT_NUM( clientindex + 1 );
|
||||
if( !SV_IsValidEdict( ent )) return;
|
||||
|
||||
if( host.type == HOST_DEDICATED )
|
||||
if( Host_IsDedicated() )
|
||||
flags |= FEV_NOTHOST; // no local clients for dedicated server
|
||||
|
||||
SV_PlaybackEventFull( flags, ent, eventindex,
|
||||
|
||||
@@ -1996,7 +1996,7 @@ qboolean SV_LoadGame( const char *pPath )
|
||||
file_t *pFile;
|
||||
int flags;
|
||||
|
||||
if( host.type == HOST_DEDICATED )
|
||||
if( Host_IsDedicated() )
|
||||
return false;
|
||||
|
||||
if( !COM_CheckString( pPath ))
|
||||
|
||||
Reference in New Issue
Block a user