From: Mario Date: Tue, 3 Jul 2018 03:16:23 +0000 (+0000) Subject: Merge branch 'martin-t/rpc-acc' into 'master' X-Git-Tag: xonotic-v0.8.5~1964 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=070ebb9d95214bf817392d9286608c812a2a7bd9;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'martin-t/rpc-acc' into 'master' Fix RPC accuracy See merge request xonotic/xonotic-data.pk3dir!535 --- 070ebb9d95214bf817392d9286608c812a2a7bd9 diff --cc qcsrc/server/g_damage.qc index 38284c30d,c2db32650..a25ae5bec --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@@ -562,11 -562,9 +562,11 @@@ void Unfreeze(entity targ if(targ.iceblock) delete(targ.iceblock); targ.iceblock = NULL; + + MUTATOR_CALLHOOK(Unfreeze, targ); } - void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) + void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) { float complainteamdamage = 0; float mirrordamage = 0; @@@ -1058,25 -1056,11 +1058,25 @@@ float RadiusDamageForSource (entity inf return total_damage_to_creatures; } - float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity) + float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity) { - return RadiusDamageForSource (inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad, cantbe, mustbe, false, forceintensity, deathtype, weaponentity, directhitentity); + 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) || IS_DEAD(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! + // TODO: armor healing? + return healed; +} + float Fire_IsBurning(entity e) { return (time < e.fire_endtime);