]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option to support damage mirroring if desired
authorMario <mario@smbclan.net>
Mon, 11 Apr 2016 02:22:10 +0000 (12:22 +1000)
committerMario <mario@smbclan.net>
Mon, 11 Apr 2016 02:22:10 +0000 (12:22 +1000)
mutators.cfg
qcsrc/common/mutators/mutator/instagib/instagib.qc
qcsrc/server/autocvars.qh

index 7e60304ccdda5588029cb08df125085b3e7d3ffc..1d7ef303f9e511fa719310526d270c7482c61d46 100644 (file)
@@ -34,6 +34,7 @@ set g_instagib_speed_highspeed 1.5 "speed-multiplier that applies while you carr
 set g_instagib_damagedbycontents 1 "allow damage from lava pits in instagib"
 set g_instagib_blaster_keepdamage 0 "allow secondary fire to hurt players"
 set g_instagib_blaster_keepforce 0 "allow secondary fire to push players"
+set g_instagib_mirrordamage 0 "allow damage mirror instagib"
 
 
 // ==========
index f8f2e5a7dfb41ec821f611b8f8573a784e97d01c..1712a86d1692d68387f9a6c96f13d01ce11a7723 100644 (file)
@@ -303,7 +303,11 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_Calculate)
                        if(frag_deathtype & HITTYPE_SECONDARY)
                        {
                                if(!autocvar_g_instagib_blaster_keepdamage || frag_attacker == frag_target)
-                                       frag_damage = frag_mirrordamage = 0;
+                               {
+                                       frag_damage = 0;
+                                       if(!autocvar_g_instagib_mirrordamage)
+                                               frag_mirrordamage = 0; // never do mirror damage on enemies
+                               }
 
                                if(frag_target != frag_attacker)
                                {
@@ -315,6 +319,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_Calculate)
                }
        }
 
+       if(!autocvar_g_instagib_mirrordamage) // only apply the taking lives hack if we don't want to support real damage mirroring
        if(IS_PLAYER(frag_attacker))
        if(frag_mirrordamage > 0)
        {
index 4a395574aa515e257cae3d950305c99a085641b6..bf5fd0eaf92cd67e20aae53dc800a33d003eeecd 100644 (file)
@@ -220,6 +220,7 @@ float autocvar_g_maxspeed;
 bool autocvar_g_instagib_damagedbycontents = true;
 bool autocvar_g_instagib_blaster_keepdamage = false;
 bool autocvar_g_instagib_blaster_keepforce = false;
+bool autocvar_g_instagib_mirrordamage;
 #define autocvar_g_mirrordamage cvar("g_mirrordamage")
 #define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual")