summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
authorBen Millwood <thebenmachine@gmail.com>2009-10-03 12:58:24 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:22 +0000
commita6690abb04d8f929f6d2d35506de0c55e1f6197e (patch)
treeeb1bfa936360766d8d0aa5edba2a72a57a4776e5 /src/game/g_buildable.c
parentb40761a5ffb5706de8c9911f25a641e498edba83 (diff)
Hive pain/death code cleaned up
* pain animation still used even without overmind * remove AHive_Die since it was broken and AHive_Pain attacks anyway - if a hive is killed in a single hit it will not react * alien buildables that die have self->powered set qfalse
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index d90c61b5..dad88840 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -845,6 +845,7 @@ void AGeneric_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, i
self->die = nullDieFunction;
self->think = AGeneric_Blast;
self->s.eFlags &= ~EF_FIRING; //prevent any firing effects
+ self->powered = qfalse;
if( self->spawned )
self->nextthink = level.time + 5000;
@@ -1387,44 +1388,12 @@ pain function for Alien Hive
*/
void AHive_Pain( gentity_t *self, gentity_t *attacker, int damage )
{
- if( self->health <= 0 || !level.overmindPresent )
- return;
-
- if( !self->active )
+ if( self->powered && !self->active )
AHive_CheckTarget( self, attacker );
G_SetBuildableAnim( self, BANIM_PAIN1, qfalse );
}
-/*
-================
-AHive_Die
-
-pain function for Alien Hive
-================
-*/
-void AHive_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod )
-{
- if( attacker && attacker->client && attacker->buildableTeam == TEAM_HUMANS &&
- self->spawned && !self->active && G_FindOvermind( self ) )
- {
- vec3_t dirToTarget;
-
- self->active = qtrue;
- self->target_ent = attacker;
- self->timestamp = level.time + HIVE_REPEAT;
-
- VectorSubtract( attacker->s.pos.trBase, self->s.pos.trBase, dirToTarget );
- VectorNormalize( dirToTarget );
- vectoangles( dirToTarget, self->turretAim );
-
- //fire at target
- FireWeapon( self );
- }
- AGeneric_Die( self, inflictor, attacker, damage, mod );
-}
-
-
//==================================================================================
@@ -3634,7 +3603,7 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori
break;
case BA_A_HIVE:
- built->die = AHive_Die;
+ built->die = AGeneric_Die;
built->think = AHive_Think;
built->pain = AHive_Pain;
break;