summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
authorMichael Levin <risujin@fastmail.fm>2009-10-03 11:16:41 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:14:49 +0000
commit5119bfd1239a0303b0ea72cf57ae6e7d3bc85897 (patch)
tree4ba8966078654c5b8a477bc84f97e1417457ad41 /src/game/g_buildable.c
parentc24c98e51210879202c4c275831afb72b4eb69ff (diff)
ACIDTUBE_REPEAT is now the actual repeat rate for Acid tube fire.
Removed the redundant AAcidTube_Damage pseudo-think function.
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c51
1 files changed, 16 insertions, 35 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 43a5dfd8..27168bbb 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -1101,36 +1101,6 @@ void AAcidTube_Think( gentity_t *self );
/*
================
-AAcidTube_Damage
-
-Damage function for Alien Acid Tube
-================
-*/
-void AAcidTube_Damage( gentity_t *self )
-{
- if( !self->spawned || self->health <= 0 )
- {
- AAcidTube_Think( self );
- return;
- }
-
- if( level.time >= self->timestamp + ACIDTUBE_REPEAT_ANIM )
- {
- self->timestamp = level.time;
- G_SetBuildableAnim( self, BANIM_ATTACK1, qfalse );
- G_AddEvent( self, EV_ALIEN_ACIDTUBE, DirToByte( self->s.origin2 ) );
- }
- G_SelectiveRadiusDamage( self->s.pos.trBase, self, ACIDTUBE_DAMAGE,
- ACIDTUBE_RANGE, self, MOD_ATUBE, PTE_ALIENS );
-
- G_CreepSlow( self );
-
- self->think = AAcidTube_Think;
- self->nextthink = level.time + ACIDTUBE_REPEAT;
-}
-
-/*
-================
AAcidTube_Think
Think function for Alien Acid Tube
@@ -1156,7 +1126,10 @@ void AAcidTube_Think( gentity_t *self )
return;
}
- if( self->spawned && G_FindOvermind( self ) )
+ G_CreepSlow( self );
+
+ // attack nearby humans
+ if( self->spawned && self->health && G_FindOvermind( self ) )
{
num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES );
for( i = 0; i < num; i++ )
@@ -1168,14 +1141,22 @@ void AAcidTube_Think( gentity_t *self )
if( enemy->client && enemy->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
{
- self->think = AAcidTube_Damage;
- break;
+ // start the attack animation
+ if( level.time >= self->timestamp + ACIDTUBE_REPEAT_ANIM )
+ {
+ self->timestamp = level.time;
+ G_SetBuildableAnim( self, BANIM_ATTACK1, qfalse );
+ G_AddEvent( self, EV_ALIEN_ACIDTUBE, DirToByte( self->s.origin2 ) );
+ }
+
+ G_SelectiveRadiusDamage( self->s.pos.trBase, self, ACIDTUBE_DAMAGE,
+ ACIDTUBE_RANGE, self, MOD_ATUBE, PTE_ALIENS );
+ self->nextthink = level.time + ACIDTUBE_REPEAT;
+ return;
}
}
}
- G_CreepSlow( self );
-
self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex );
}