From: Mario Date: Mon, 11 Apr 2016 02:22:10 +0000 (+1000) Subject: Add an option to support damage mirroring if desired X-Git-Tag: xonotic-v0.8.2~966 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ebe2e4ee513b416a32739dcaf0e1d2b569035fae;p=xonotic%2Fxonotic-data.pk3dir.git Add an option to support damage mirroring if desired --- diff --git a/mutators.cfg b/mutators.cfg index 7e60304cc..1d7ef303f 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -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" // ========== diff --git a/qcsrc/common/mutators/mutator/instagib/instagib.qc b/qcsrc/common/mutators/mutator/instagib/instagib.qc index f8f2e5a7d..1712a86d1 100644 --- a/qcsrc/common/mutators/mutator/instagib/instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/instagib.qc @@ -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) { diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 4a395574a..bf5fd0eaf 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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")