]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/minelayer.qc
Implement TakeResource
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / minelayer.qc
index a36f2f09681623827e2362b1c4012ea9c75a21c3..6d3270a2b22788e6539f82115f93d72a2ef8b18c 100644 (file)
@@ -257,7 +257,7 @@ void W_MineLayer_Damage(entity this, entity inflictor, entity attacker, float da
        if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, (is_from_enemy ? 1 : -1)))
                return; // g_projectiles_damage says to halt
 
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH) - damage);
+       TakeResource(this, RESOURCE_HEALTH, damage);
        this.angles = vectoangles(this.velocity);
 
        if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0)