diff options
author | Roman Tetelman <kevlarman@gmail.com> | 2009-10-03 12:05:12 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:15:39 +0000 |
commit | 3bab258f94500c48a46c14e68ff81005483e6ebf (patch) | |
tree | bd842030c12daa63ce8f09a0f2c5ff9b5ed15375 /src/game | |
parent | 30386f196338d06c92eee69abab009f368a63813 (diff) |
* CG_PLAYER_LOCATION now determined by the client
* add trap_R_inPVS to cg_local.h/cg_syscalls.asm
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_public.h | 2 | ||||
-rw-r--r-- | src/game/g_target.c | 7 | ||||
-rw-r--r-- | src/game/g_team.c | 42 |
3 files changed, 21 insertions, 30 deletions
diff --git a/src/game/bg_public.h b/src/game/bg_public.h index b40863df..df1bc0ba 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -1167,6 +1167,8 @@ typedef enum ET_BUILDABLE, // buildable type + ET_LOCATION, + ET_MISSILE, ET_MOVER, ET_BEAM, diff --git a/src/game/g_target.c b/src/game/g_target.c index b2c2d9ab..9e110162 100644 --- a/src/game/g_target.c +++ b/src/game/g_target.c @@ -298,10 +298,10 @@ static void target_location_linkup( gentity_t *ent ) for( i = 0, ent = g_entities, n = 1; i < level.num_entities; i++, ent++) { - if( ent->classname && !Q_stricmp( ent->classname, "target_location" ) ) + if( ent->s.eType == ET_LOCATION ) { // lets overload some variables! - ent->health = n; // use for location marking + ent->s.generic1 = n; // use for location marking trap_SetConfigstring( CS_LOCATIONS + n, ent->message ); n++; ent->nextTrain = level.locationHead; @@ -323,7 +323,8 @@ void SP_target_location( gentity_t *self ) { self->think = target_location_linkup; self->nextthink = level.time + 200; // Let them all spawn first - + self->s.eType = ET_LOCATION; + trap_LinkEntity( self ); // make the server send them to the clients G_SetOrigin( self, self->s.origin ); } diff --git a/src/game/g_team.c b/src/game/g_team.c index 845ea65e..7ec6855c 100644 --- a/src/game/g_team.c +++ b/src/game/g_team.c @@ -77,7 +77,7 @@ gentity_t *Team_GetLocation( gentity_t *ent ) best = NULL; bestlen = 3.0f * 8192.0f * 8192.0f; - VectorCopy( ent->client->ps.origin, origin ); + VectorCopy( ent->r.currentOrigin, origin ); for( eloc = level.locationHead; eloc; eloc = eloc->nextTrain ) { @@ -160,28 +160,9 @@ void TeamplayInfoMessage( gentity_t *ent ) int h, a = 0; int clients[ TEAM_MAXOVERLAY ]; - //hack: always send each client's teaminfo to it for CG_PLAYER_LOCATION - h = ent->client->ps.stats[ STAT_HEALTH ]; - if( h < 0 ) - h = 0; - - trap_SendServerCommand( ent - g_entities, - va("tinfo %i %i %i %i %i %i", - 1, - ent - g_entities, - ent->client->pers.location, - h, - a, - ent->client->ps.weapon ) ); - if( ! ent->client->pers.teamInfo ) return; - if( !ent->inuse || - ( !( ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) && - !( ent->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) ) ) - return; - // figure out what client should be on the display // we are limited to 8, but we want to use the top eight players // but in client order (so they don't keep changing position on the overlay) @@ -247,12 +228,17 @@ void CheckTeamStatus( void ) if( ent->client->pers.connected != CON_CONNECTED ) continue; - loc = Team_GetLocation( ent ); - if( loc ) - ent->client->pers.location = loc->health; - else - ent->client->pers.location = 0; - + if( ent->inuse && ( ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS || + ent->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) ) + { + + loc = Team_GetLocation( ent ); + + if( loc ) + ent->client->pers.location = loc->s.generic1; + else + ent->client->pers.location = 0; + } } for( i = 0; i < g_maxclients.integer; i++ ) @@ -261,7 +247,9 @@ void CheckTeamStatus( void ) if( ent->client->pers.connected != CON_CONNECTED ) continue; - TeamplayInfoMessage( ent ); + if( ent->inuse && ( ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS || + ent->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) ) + TeamplayInfoMessage( ent ); } } } |