summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2010-03-31 22:21:05 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:33 +0000
commit9b595718735659804658d757fa6d33c2d78380d2 (patch)
treef43969e7fab9f5b544297b0416c7c8710a2dc6fc
parent7fb0c4389dab34e50e8b31997dcb12dff934ed9d (diff)
* (bug 3243) /notarget cheat extended to buildables (thanks benmachine)
-rw-r--r--src/game/g_buildable.c29
-rw-r--r--src/game/g_combat.c3
-rw-r--r--src/game/g_missile.c4
3 files changed, 36 insertions, 0 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 973c7b91..93e11802 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -644,6 +644,9 @@ static void G_CreepSlow( gentity_t *self )
{
enemy = &g_entities[ entityList[ i ] ];
+ if( enemy->flags & FL_NOTARGET )
+ continue;
+
if( enemy->client && enemy->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS &&
enemy->client->ps.groundEntityNum != ENTITYNUM_NONE )
{
@@ -1176,6 +1179,9 @@ void AAcidTube_Think( gentity_t *self )
{
enemy = &g_entities[ entityList[ i ] ];
+ if( enemy->flags & FL_NOTARGET )
+ continue;
+
if( !G_Visible( self, enemy, CONTENTS_SOLID ) )
continue;
@@ -1220,6 +1226,9 @@ static qboolean AHive_CheckTarget( gentity_t *self, gentity_t *enemy )
enemy->client->ps.stats[ STAT_TEAM ] != TEAM_HUMANS )
return qfalse;
+ if( enemy->flags & FL_NOTARGET )
+ return qfalse;
+
// Check if the tip of the hive can see the target
VectorMA( self->s.pos.trBase, self->r.maxs[ 2 ], self->s.origin2,
tip_origin );
@@ -1322,6 +1331,9 @@ void ABooster_Touch( gentity_t *self, gentity_t *other, trace_t *trace )
if( client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS )
return;
+ if( other->flags & FL_NOTARGET )
+ return; // notarget cancels even beneficial effects?
+
client->ps.stats[ STAT_STATE ] |= SS_BOOSTED;
client->boostedTime = level.time;
}
@@ -1406,6 +1418,8 @@ qboolean ATrapper_CheckTarget( gentity_t *self, gentity_t *target, int range )
return qfalse;
if( !target->client ) // is the target a bot or player?
return qfalse;
+ if( target->flags & FL_NOTARGET ) // is the target cheating?
+ return qfalse;
if( target->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) // one of us?
return qfalse;
if( target->client->sess.spectatorState != SPECTATOR_NOT ) // is the target alive?
@@ -1851,6 +1865,8 @@ void HReactor_Think( gentity_t *self )
if( !enemy->client ||
enemy->client->ps.stats[ STAT_TEAM ] != TEAM_ALIENS )
continue;
+ if( enemy->flags & FL_NOTARGET )
+ continue;
tent = G_TempEntity( enemy->s.pos.trBase, EV_TESLATRAIL );
tent->s.generic1 = self->s.number; //src
@@ -2032,6 +2048,9 @@ void HMedistat_Think( gentity_t *self )
for( i = 0; i < num; i++ )
{
player = &g_entities[ entityList[ i ] ];
+
+ if( player->flags & FL_NOTARGET )
+ continue; // notarget cancels even beneficial effects?
//remove poison from everyone, not just the healed player
if( player->client && player->client->ps.stats[ STAT_STATE ] & SS_POISONED )
@@ -2056,6 +2075,9 @@ void HMedistat_Think( gentity_t *self )
{
player = &g_entities[ entityList[ i ] ];
+ if( player->flags & FL_NOTARGET )
+ continue; // notarget cancels even beneficial effects?
+
if( player->client && player->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS )
{
if( ( player->health < player->client->ps.stats[ STAT_MAX_HEALTH ] ||
@@ -2131,6 +2153,9 @@ qboolean HMGTurret_CheckTarget( gentity_t *self, gentity_t *target,
if( !target || target->health <= 0 || !target->client ||
target->client->pers.teamSelection != TEAM_ALIENS )
return qfalse;
+
+ if( target->flags & FL_NOTARGET )
+ return qfalse;
if( !los_check )
return qtrue;
@@ -2432,6 +2457,10 @@ void HTeslaGen_Think( gentity_t *self )
for( i = 0; i < num; i++ )
{
self->enemy = &g_entities[ entityList[ i ] ];
+
+ if( self->enemy->flags & FL_NOTARGET )
+ continue;
+
if( self->enemy->client && self->enemy->health > 0 &&
self->enemy->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS &&
Distance( self->enemy->s.pos.trBase,
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 44dfa1c1..f602f0af 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -1243,6 +1243,9 @@ qboolean G_SelectiveRadiusDamage( vec3_t origin, gentity_t *attacker, float dama
if( !ent->takedamage )
continue;
+ if( ent->flags & FL_NOTARGET )
+ continue;
+
// find the distance from the edge of the bounding box
for( i = 0 ; i < 3 ; i++ )
{
diff --git a/src/game/g_missile.c b/src/game/g_missile.c
index 58bd9380..8538777f 100644
--- a/src/game/g_missile.c
+++ b/src/game/g_missile.c
@@ -612,6 +612,10 @@ void AHive_SearchAndDestroy( gentity_t *self )
for( i = 0; i < MAX_CLIENTS; i++ )
{
ent = &g_entities[ i ];
+
+ if( ent->flags & FL_NOTARGET )
+ continue;
+
if( ent->client &&
ent->health > 0 &&
ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS &&