commit 22342fcdfa66d371a69f666e6505a447d9c8a8e2 Author: devhc Date: Wed Jul 13 15:27:14 2011 +0200 add range marker compatibility hack diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index b1af50c..1204c7f 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -4466,6 +4466,8 @@ G_UpdateBuildableRangeMarkers */ void G_UpdateBuildableRangeMarkers( void ) { + qboolean support_for_64bit_clientmasks = ( trap_Cvar_VariableIntegerValue( "sv_gppCompat" ) >= 1 ); + gentity_t *e; for( e = &g_entities[ MAX_CLIENTS ]; e < &g_entities[ level.num_entities ]; ++e ) { @@ -4486,7 +4488,10 @@ void G_UpdateBuildableRangeMarkers( void ) vectoangles( e->s.origin2, e->rangeMarker->s.apos.trBase ); e->rangeMarker->r.singleClient = 0; - e->rangeMarker->r.hiMask = 0; + e->rangeMarker->r.compat.generic1 = 0; + + // remove any previously added noclient flags (see the hack below) + e->rangeMarker->r.svFlags &= ~SVF_NOCLIENT; for( i = 0; i < level.maxclients; ++i ) { @@ -4498,6 +4503,29 @@ void G_UpdateBuildableRangeMarkers( void ) if( client->pers.connected != CON_CONNECTED ) continue; + if( i >= 32 && !support_for_64bit_clientmasks ) + { + // resort to not sending any range markers + static qboolean warned = qfalse; + + if( !warned ) + { + trap_SendServerCommand( -1, "print \"" S_COLOR_YELLOW "WARNING: There is no " + "support for 64-bit clientmasks on this server. Please update your server " + "executable. Until then, range markers will not be displayed while there " + "are clients with client numbers above 31 in the game.\n\"" ); + warned = qtrue; + } + + for( e = &g_entities[ MAX_CLIENTS ]; e < &g_entities[ level.num_entities ]; ++e ) + { + if( e->s.eType == ET_BUILDABLE && e->rangeMarker ) + e->rangeMarker->r.svFlags |= SVF_NOCLIENT; + } + + return; + } + team = client->pers.teamSelection; if( team != TEAM_NONE ) { @@ -4509,7 +4537,7 @@ void G_UpdateBuildableRangeMarkers( void ) if( ( team == TEAM_NONE || ( team == bTeam && weaponDisplays ) ) && wantsToSee ) { if( i >= 32 ) - e->rangeMarker->r.hiMask |= 1 << ( i - 32 ); + e->rangeMarker->r.compat.generic1 |= 1 << ( i - 32 ); else e->rangeMarker->r.singleClient |= 1 << i; }