From: packer Date: Sat, 22 Sep 2018 11:37:48 +0000 (+0200) Subject: clan arena: X-Git-Tag: xonotic-v0.8.5~1832^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b57124c29ae0d8c873e0523da3275686b42da91b;p=xonotic%2Fxonotic-data.pk3dir.git clan arena: - fix how scoring is performed when damage exceeds remaining health/armor fragged player (e.g. telefrag and void frag) - dont give any score when killing teammates --- diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc index 4c889cb24..4f255c19c 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc @@ -380,12 +380,12 @@ MUTATOR_HOOKFUNCTION(ca, PlayerDamage_SplitHealthArmor) entity frag_attacker = M_ARGV(1, entity); entity frag_target = M_ARGV(2, entity); float frag_damage = M_ARGV(7, float); - float damage_take = M_ARGV(4, float); - float damage_save = M_ARGV(5, float); + float damage_take = bound(0, M_ARGV(4, float), GetResourceAmount(frag_target, RESOURCE_HEALTH)); + float damage_save = bound(0, M_ARGV(5, float), GetResourceAmount(frag_target, RESOURCE_ARMOR)); float excess = max(0, frag_damage - damage_take - damage_save); - if (frag_target != frag_attacker && IS_PLAYER(frag_attacker)) + if (frag_target != frag_attacker && IS_PLAYER(frag_attacker) && !SAME_TEAM(frag_target, frag_attacker)) GameRules_scoring_add_team(frag_attacker, SCORE, (frag_damage - excess) * autocvar_g_ca_damage2score_multiplier); }