summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
authorPetr Pudlak <petr.mvd@gmail.com>2015-03-03 22:50:49 +0100
committerPetr Pudlak <petr.mvd@gmail.com>2015-03-14 22:05:46 +0100
commit61cb2ac4ed5b6724ea51fb2cce6fc22c02be75c9 (patch)
tree6db0e0debfd7fabb3434e0119ea6e49b1d903e55 /src/game/g_buildable.c
parent4de47be4e4d5edd51c4dd0bb1a036da36f8bee81 (diff)
Fix spiteful abcess death that kills all H structures around
The important part is fixing the 'think' function. The rest is just correcting style and spacing.
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 6d42335..62aa7c7 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -1924,7 +1924,7 @@ ASPITEFUL_ABCESS_Die
Die for alien SPITEFUL_ABCESS
================
*/
-void ASPITEFUL_ABCESS_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod )
+void ASpitefulAbcess_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod )
{
vec3_t dir;
vec3_t range = { 250.0f, 250.0f, 250.0f };
@@ -1943,18 +1943,20 @@ void ASPITEFUL_ABCESS_Die( gentity_t *self, gentity_t *inflictor, gentity_t *att
if ( self->spawned )
{
- // Grab all entities around us
- VectorAdd(self->s.origin, range, maxs);
- VectorSubtract(self->s.origin, range, mins);
-
- total_entities = trap_EntitiesInBox(mins, maxs, entityList, MAX_GENTITIES);
-
- // Loop entities looking for an enemy body
- for(i=0; i<total_entities; i++) {
- target = &g_entities[entityList[i]];
- if(target->client && target->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS) {
- if (G_Visible( self, target, MASK_SHOT ))
- {
+ // Grab all entities around us
+ VectorAdd(self->s.origin, range, maxs);
+ VectorSubtract(self->s.origin, range, mins);
+
+ total_entities = trap_EntitiesInBox(mins, maxs, entityList, MAX_GENTITIES);
+
+ // Loop entities looking for an enemy body
+ for( i = 0; i < total_entities; i++ )
+ {
+ target = &g_entities[entityList[i]];
+ if( target->client && target->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS )
+ {
+ if( G_Visible( self, target, MASK_SHOT ) )
+ {
if( BG_InventoryContainsUpgrade( UP_LIGHTARMOUR, target->client->ps.stats ) )
continue;
@@ -1969,9 +1971,9 @@ void ASPITEFUL_ABCESS_Die( gentity_t *self, gentity_t *inflictor, gentity_t *att
//target->client->lastPoisonCloudedClient = self;
trap_SendServerCommand( target->client->ps.clientNum, "poisoncloud" );
}
- }
- }
- }
+ }
+ }
+ }
}
//pretty events and item cleanup
@@ -1979,7 +1981,7 @@ void ASPITEFUL_ABCESS_Die( gentity_t *self, gentity_t *inflictor, gentity_t *att
G_AddEvent( self, EV_ALIEN_BUILDABLE_EXPLOSION, DirToByte( dir ) );
self->s.eFlags &= ~EF_FIRING; //prevent any firing effects
self->timestamp = level.time;
- self->think = ASpawn_Melt;
+ self->think = AGeneric_Blast;
self->nextthink = level.time + 500; //wait .5 seconds before damaging others
self->die = nullDieFunction;
@@ -4532,7 +4534,7 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable,
case BA_A_SPITEFUL_ABCESS:
built->think = G_Scan;
- built->die = ASPITEFUL_ABCESS_Die;
+ built->die = ASpitefulAbcess_Die;
built->pain = AGeneric_Pain;
break;