]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'martin-t/rpc-acc' into 'master'
authorMario <zacjardine@y7mail.com>
Tue, 3 Jul 2018 03:16:23 +0000 (03:16 +0000)
committerMario <zacjardine@y7mail.com>
Tue, 3 Jul 2018 03:16:23 +0000 (03:16 +0000)
Fix RPC accuracy

See merge request xonotic/xonotic-data.pk3dir!535

1  2 
qcsrc/common/mutators/mutator/overkill/okrpc.qc
qcsrc/server/g_damage.qc

index 38284c30decd8a5b3adae3fbebe9039ef7e560ef,c2db32650dd851c363ca44ed123641dcdbf8d5d6..a25ae5bec9f878d9ba5feca5a6bb2f7e7c55bae6
@@@ -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);