]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Implement a proper Heal function for the Arc's ability, so specific entities can...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index bdbe77352a6f1264df9b72e32ed4c62e042c490e..92a80969c2fb17a88a7bfd7f43e8a22f98abfc46 100644 (file)
@@ -1061,6 +1061,19 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
        return RadiusDamageForSource (inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad, cantbe, mustbe, false, forceintensity, deathtype, weaponentity, directhitentity);
 }
 
+bool Heal(entity targ, entity inflictor, float amount, float limit)
+{
+       if(game_stopped || (IS_CLIENT(targ) && CS(targ).killcount == FRAGS_SPECTATOR) || STAT(FROZEN, targ))
+               return false;
+
+       bool healed = false;
+       if(targ.event_heal)
+               healed = targ.event_heal(targ, inflictor, amount, limit);
+       // TODO: additional handling? what if the healing kills them? should this abort if healing would do so etc
+       // TODO: healing fx!
+       return healed;
+}
+
 float Fire_IsBurning(entity e)
 {
        return (time < e.fire_endtime);