]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/hook.qc
Purge self from event_damage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / hook.qc
index 216a82074f391048f50b2a4cbca05ef51f71b3af..8fc13f9e1c40f317cbc861c356f233ced4b2ea56 100644 (file)
@@ -118,18 +118,18 @@ void W_Hook_Explode2()
        self.movetype = MOVETYPE_NONE;
 }
 
-void W_Hook_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{SELFPARAM();
-       if(self.health <= 0)
+void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+       if(this.health <= 0)
                return;
 
-       if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+       if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
                return; // g_projectiles_damage says to halt
 
-       self.health = self.health - damage;
+       this.health = this.health - damage;
 
-       if(self.health <= 0)
-               W_PrepareExplosionByDamage(self.realowner, W_Hook_Explode2);
+       if(this.health <= 0)
+               WITH(entity, self, this, W_PrepareExplosionByDamage(this.realowner, W_Hook_Explode2));
 }
 
 void W_Hook_Touch2()
@@ -319,8 +319,8 @@ void W_Hook_Attack2(Weapon thiswep, entity actor)
 #endif
 
 #ifdef CSQC
-#include "../../../lib/csqcmodel/interpolate.qh"
-#include "../../../lib/warpzone/common.qh"
+#include <lib/csqcmodel/interpolate.qh>
+#include <lib/warpzone/common.qh>
 
 void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg);