remove(self);
}
+void W_Mortar_Grenade_Explode_use(entity this, entity actor, entity trigger)
+{
+ WITHSELF(this, W_Mortar_Grenade_Explode());
+}
+
void W_Mortar_Grenade_Explode2()
{SELFPARAM();
if(other.takedamage == DAMAGE_AIM)
remove(self);
}
+void W_Mortar_Grenade_Explode2_use(entity this, entity actor, entity trigger)
+{
+ WITHSELF(this, W_Mortar_Grenade_Explode2());
+}
void W_Mortar_Grenade_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
this.health = this.health - damage;
if(this.health <= 0)
- WITH(entity, self, this, W_PrepareExplosionByDamage(attacker, this.use));
+ W_PrepareExplosionByDamage(this, attacker, adaptor_think2use);
}
void W_Mortar_Grenade_Think1()
PROJECTILE_TOUCH;
if(other.takedamage == DAMAGE_AIM || WEP_CVAR_PRI(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
{
- self.use();
+ this.use(this, NULL, NULL);
}
else if(WEP_CVAR_PRI(mortar, type) == 1) // bounce
{
PROJECTILE_TOUCH;
if(other.takedamage == DAMAGE_AIM || WEP_CVAR_SEC(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
{
- self.use();
+ this.use(this, NULL, NULL);
}
else if(WEP_CVAR_SEC(mortar, type) == 1) // bounce
{
gren.cnt = time + WEP_CVAR_PRI(mortar, lifetime);
gren.nextthink = time;
gren.think = W_Mortar_Grenade_Think1;
- gren.use = W_Mortar_Grenade_Explode;
+ gren.use = W_Mortar_Grenade_Explode_use;
gren.touch = W_Mortar_Grenade_Touch1;
gren.takedamage = DAMAGE_YES;
gren.nextthink = time + WEP_CVAR_SEC(mortar, lifetime);
gren.think = adaptor_think2use_hittype_splash;
- gren.use = W_Mortar_Grenade_Explode2;
+ gren.use = W_Mortar_Grenade_Explode2_use;
gren.touch = W_Mortar_Grenade_Touch2;
gren.takedamage = DAMAGE_YES;