]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/turret/hellion_weapon.qc
Give W_SetupShot a deathtype parameter, fixes some ugly hacks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / hellion_weapon.qc
index 0b112f22609178d55ebecb76a976187aaa92731e..1c12a33c65559181d455df5cb2f90381bb1008bf 100644 (file)
@@ -1,7 +1,5 @@
 #include "hellion_weapon.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 float autocvar_g_turrets_unit_hellion_shot_speed_gain;
@@ -15,7 +13,7 @@ METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weapo
     if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
         if (isPlayer) {
             turret_initparams(actor);
-            W_SetupShot_Dir(actor, v_forward, false, 0, SND_HellionAttack_FIRE, CH_WEAPON_B, 0);
+            W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_HellionAttack_FIRE, CH_WEAPON_B, 0, DEATH_TURRET_HELLION.m_id);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
@@ -33,7 +31,6 @@ METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weapo
         te_explosion (missile.origin);
         setthink(missile, turret_hellion_missile_think);
         missile.nextthink      = time;
-        missile.flags          = FL_PROJECTILE;
         missile.max_health   = time + 9;
         missile.tur_aimpos   = randomvec() * 128;
         missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
@@ -55,11 +52,11 @@ void turret_hellion_missile_think(entity this)
         turret_projectile_explode(this);
 
     // Enemy dead? just keep on the current heading then.
-    if ((this.enemy == world) || (IS_DEAD(this.enemy)))
+    if ((this.enemy == NULL) || (IS_DEAD(this.enemy)))
     {
 
         // Make sure we dont return to tracking a respawned player
-        this.enemy = world;
+        this.enemy = NULL;
 
         // Turn model
         this.angles = vectoangles(this.velocity);
@@ -104,5 +101,3 @@ void turret_hellion_missile_think(entity this)
 }
 
 #endif
-
-#endif