]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move some more CA damage checks into the mutator hook
authorMario <mario.mario@y7mail.com>
Fri, 14 Jun 2013 12:48:51 +0000 (22:48 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 14 Jun 2013 12:48:51 +0000 (22:48 +1000)
qcsrc/server/g_damage.qc
qcsrc/server/mutators/gamemode_ca.qc

index d35af7cac698d5d0e9a0d49eac298042d0969ac0..bd4fe2b8b07a143b9c9009b70b8ab36283e1bacb 100644 (file)
@@ -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)
index bf8fbbcbc5fcaa36a102e9543aab95d7fb51247a..1f43bdde8b5a9d6f99edfac9f6517bac0fac6550 100644 (file)
@@ -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;
 }