]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/hook.qc
Merge branch 'terencehill/menu_fixes' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / hook.qc
index 91c2840e6d35e47fefeb0dc3a1a12905949f3c7c..fac16c48716422cdc800cb1e62cd3c999947ce13 100644 (file)
@@ -118,6 +118,11 @@ void W_Hook_Explode2()
        self.movetype = MOVETYPE_NONE;
 }
 
+void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
+{
+       WITHSELF(this, W_Hook_Explode2());
+}
+
 void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        if(this.health <= 0)
@@ -129,13 +134,13 @@ void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage,
        this.health = this.health - damage;
 
        if(this.health <= 0)
-               WITHSELF(this, W_PrepareExplosionByDamage(this.realowner, W_Hook_Explode2));
+               W_PrepareExplosionByDamage(this, this.realowner, W_Hook_Explode2);
 }
 
 void W_Hook_Touch2()
 {SELFPARAM();
        PROJECTILE_TOUCH;
-       self.use();
+       this.use(this, NULL, NULL);
 }
 
 void W_Hook_Attack2(Weapon thiswep, entity actor)
@@ -155,7 +160,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor)
 
        gren.nextthink = time + WEP_CVAR_SEC(hook, lifetime);
        gren.think = adaptor_think2use_hittype_splash;
-       gren.use = W_Hook_Explode2;
+       gren.use = W_Hook_Explode2_use;
        gren.touch = W_Hook_Touch2;
 
        gren.takedamage = DAMAGE_YES;