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

index f8a77a2cd4f194c16e33c4fba4d2b975c871d07d..d35af7cac698d5d0e9a0d49eac298042d0969ac0 100644 (file)
@@ -708,7 +708,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
 
                if (targ == attacker)
                {
-                       if(g_ca || (g_cts && !autocvar_g_cts_selfdamage))
+                       if(g_cts && !autocvar_g_cts_selfdamage)
                                damage = 0;
                        else
                                damage = damage * autocvar_g_balance_selfdamagepercent; // Partial damage if the attacker hits himself
index 7c8c1cb77c62c8d451e5fa7f0def6c9cc5e5e019..bf8fbbcbc5fcaa36a102e9543aab95d7fb51247a 100644 (file)
@@ -238,6 +238,15 @@ MUTATOR_HOOKFUNCTION(ca_SetStartItems)
        return 0;
 }
 
+MUTATOR_HOOKFUNCTION(ca_PlayerDamage)
+{
+       if(IS_PLAYER(frag_attacker))
+       if(frag_target == frag_attacker)
+               frag_damage = 0;
+               
+       return FALSE;
+}
+
 // scoreboard setup
 void ca_ScoreRules()
 {
@@ -280,6 +289,7 @@ MUTATOR_DEFINITION(gamemode_ca)
        MUTATOR_HOOK(ForbidThrowCurrentWeapon, ca_ForbidThrowCurrentWeapon, CBC_ORDER_ANY);
        MUTATOR_HOOK(GiveFragsForKill, ca_GiveFragsForKill, CBC_ORDER_FIRST);
        MUTATOR_HOOK(SetStartItems, ca_SetStartItems, CBC_ORDER_ANY);
+       MUTATOR_HOOK(PlayerDamage_Calculate, ca_PlayerDamage, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {