From: Mario Date: Fri, 14 Jun 2013 12:48:51 +0000 (+1000) Subject: Move some more CA damage checks into the mutator hook X-Git-Tag: xonotic-v0.8.0~366^2~13 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=162296b80eeb4a1033e69606f1e83f21dd89c201;p=xonotic%2Fxonotic-data.pk3dir.git Move some more CA damage checks into the mutator hook --- diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index d35af7cac..bd4fe2b8b 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -626,13 +626,10 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float { attacker.dmg_team = attacker.dmg_team + damage; complainteamdamage = attacker.dmg_team - autocvar_g_teamdamage_threshold; - if(complainteamdamage > 0 && !g_ca) // FIXME why is g_ca ruled out here? Why not just g_mirrordamage 0 on CA servers? + if(complainteamdamage > 0) mirrordamage = autocvar_g_mirrordamage * complainteamdamage; mirrorforce = autocvar_g_mirrordamage * vlen(force); - if(g_ca) - damage = 0; - else - damage = autocvar_g_friendlyfire * damage; + damage = autocvar_g_friendlyfire * damage; // mirrordamage will be used LATER if(autocvar_g_mirrordamage_virtual) diff --git a/qcsrc/server/mutators/gamemode_ca.qc b/qcsrc/server/mutators/gamemode_ca.qc index bf8fbbcbc..1f43bdde8 100644 --- a/qcsrc/server/mutators/gamemode_ca.qc +++ b/qcsrc/server/mutators/gamemode_ca.qc @@ -240,10 +240,13 @@ MUTATOR_HOOKFUNCTION(ca_SetStartItems) MUTATOR_HOOKFUNCTION(ca_PlayerDamage) { - if(IS_PLAYER(frag_attacker)) - if(frag_target == frag_attacker) + if(IS_PLAYER(frag_target)) + if(frag_target.deadflag == DEAD_NO) + if(frag_target == frag_attacker || !IsDifferentTeam(frag_target, frag_attacker)) frag_damage = 0; + frag_mirrordamage = 0; + return FALSE; }