From 487154dd6c254351f405a85a4264e97b2a141323 Mon Sep 17 00:00:00 2001 From: Petr Pudlak Date: Thu, 19 Feb 2015 22:11:18 +0100 Subject: Let turrets also target any alien buildings --- src/game/g_buildable.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 18a0fae..7247d9a 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -2891,9 +2891,20 @@ qboolean HMGTurret_CheckTarget( gentity_t *self, gentity_t *target, trace_t tr; vec3_t dir, end; - if( !target || target->health <= 0 || !target->client || - target->client->pers.teamSelection != TEAM_ALIENS ) - return qfalse; + if( !target || target->health <= 0 ) + return qfalse; + + if( target->client ) + { + if( target->client->pers.teamSelection != TEAM_ALIENS ) + return qfalse; + } + else + { + if( !( target->s.eType == ET_BUILDABLE && + BG_Buildable( target->s.modelindex )->team == TEAM_ALIENS ) ) + return qfalse; + } if( target->flags & FL_NOTARGET ) return qfalse; -- cgit From 84745a87a8c36ab4f87d2514b7fcee6733544504 Mon Sep 17 00:00:00 2001 From: Petr Pudlak Date: Fri, 20 Feb 2015 12:14:54 +0100 Subject: Let acid tubes damage human structures This also includes extending G_SelectiveRadiusDamage to include any enemy buildings. --- src/game/g_buildable.c | 4 +++- src/game/g_combat.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 7247d9a..dbe1f1d 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1505,7 +1505,9 @@ void AAcidTube_Think( gentity_t *self ) if (enemy->client && enemy->client->notrackEndTime >= level.time) continue; - if( enemy->client && enemy->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) + if( ( enemy->client && enemy->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) || + ( enemy->s.eType == ET_BUILDABLE && + BG_Buildable( enemy->s.modelindex )->team == TEAM_HUMANS ) ) { // start the attack animation if( level.time >= self->timestamp + ACIDTUBE_REPEAT_ANIM ) diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 4685439..b0e33e4 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -1571,8 +1571,10 @@ qboolean G_SelectiveRadiusDamage( vec3_t origin, gentity_t *attacker, float dama points = damage * ( 1.0 - dist / radius ); - if( CanDamage( ent, origin ) && ent->client && - ent->client->ps.stats[ STAT_TEAM ] != team ) + if( CanDamage( ent, origin ) && + ( ( ent->client && ent->client->ps.stats[ STAT_TEAM ] != team ) || + ( ent->s.eType == ET_BUILDABLE && + BG_Buildable( ent->s.modelindex )->team != team ) ) ) { VectorSubtract( ent->r.currentOrigin, origin, dir ); // push the center of mass higher than the origin so players -- cgit