summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIronClawTrem <louie.nutman@gmail.com>2020-03-15 16:44:52 +0000
committerIronClawTrem <louie.nutman@gmail.com>2020-03-15 16:44:52 +0000
commit618e63e53960814dc42ad9a09c326904a2226cad (patch)
treef98ec3c744a6f6585604601db8f553b329bba766
parent5b1d432055194582fafc00a22b3838666dc83851 (diff)
add AGeneric_Die function for barricade shrink
it seems like all other alien buildables re-use ABarricade_Die and we dont want this for barricade shrink
-rw-r--r--src/game/g_buildable.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 62d757d..2e2a2d8 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -1019,12 +1019,13 @@ void ABarricade_Shrink( gentity_t *self, qboolean shrink )
/*
================
-ABarricade_Die
+AGeneric_Die
-Called when an alien spawn dies
+Called when an alien buildable dies
================
*/
-void ABarricade_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod )
+
+void AGeneric_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod )
{
buildHistory_t *new;
new = G_Alloc( sizeof( buildHistory_t ) );
@@ -1052,8 +1053,6 @@ void ABarricade_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker,
self->think = ABarricade_Blast;
self->s.eFlags &= ~EF_FIRING; //prevent any firing effects
- ABarricade_Shrink( self, qtrue );
-
if( self->spawned )
self->nextthink = level.time + 5000;
else
@@ -1081,6 +1080,19 @@ void ABarricade_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker,
/*
================
+ABarricade_Die
+
+Called when an alien spawn dies
+================
+*/
+void ABarricade_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod )
+{
+ AGeneric_Die( self, inflictor, attacker, damage, mod );
+ ABarricade_Shrink( self, qtrue );
+}
+
+/*
+================
ABarricade_Think
Think function for Alien Barricade
@@ -3709,26 +3721,26 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori
break;
case BA_A_BOOSTER:
- built->die = ABarricade_Die;
+ built->die = AGeneric_Die;
built->think = ABooster_Think;
built->pain = ABarricade_Pain;
built->touch = ABooster_Touch;
break;
case BA_A_ACIDTUBE:
- built->die = ABarricade_Die;
+ built->die = AGeneric_Die;
built->think = AAcidTube_Think;
built->pain = ASpawn_Pain;
break;
case BA_A_HIVE:
- built->die = ABarricade_Die;
+ built->die = AGeneric_Die;
built->think = AHive_Think;
built->pain = ASpawn_Pain;
break;
case BA_A_TRAPPER:
- built->die = ABarricade_Die;
+ built->die = AGeneric_Die;
built->think = ATrapper_Think;
built->pain = ASpawn_Pain;
break;