From: Mario Date: Wed, 13 Apr 2016 05:02:09 +0000 (+1000) Subject: Add a cvar to prevent mirroring damage if the attack wasn't from a weapon (burning... X-Git-Tag: xonotic-v0.8.2~963 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c136682073d6ae8ad284a88958616e5125b617a4;p=xonotic%2Fxonotic-data.pk3dir.git Add a cvar to prevent mirroring damage if the attack wasn't from a weapon (burning, drowning etc) --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index e1531205e..bdb24adef 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -490,6 +490,7 @@ set g_tdm_on_dm_maps 0 "when this is set, all DM maps automatically support TDM" seta teamplay_mode 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the cvars g_mirrordamage*, g_friendlyfire* and g_teamdamage_threshold*" seta g_mirrordamage 0.700000 "for teamplay 4: mirror damage factor" seta g_mirrordamage_virtual 1 "for teamplay 4: do not actually apply mirror damage, just show graphics effect for it" +seta g_mirrordamage_onlyweapons 0 "for teamplay 4: only apply mirror damage if the attack was from a weapon" seta g_friendlyfire 0.500000 "for teamplay 4: fiendly fire factor" seta g_friendlyfire_virtual 1 "for teamplay 4: do not actually apply friendly fire, just show graphics effect for it" seta g_friendlyfire_virtual_force 1 "for teamplay 4: apply force even though damage was made virtual only" diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 943efc404..c565298e8 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -224,6 +224,7 @@ bool autocvar_g_instagib_mirrordamage; bool autocvar_g_instagib_friendlypush = true; #define autocvar_g_mirrordamage cvar("g_mirrordamage") #define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual") +bool autocvar_g_mirrordamage_onlyweapons; float autocvar_g_movement_highspeed = 1; string autocvar_g_mutatormsg; diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 208ae62e5..86e260e9f 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -873,6 +873,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d setself(this); // apply mirror damage if any + if(!autocvar_g_mirrordamage_onlyweapons || DEATH_WEAPONOF(deathtype) != WEP_Null) if(mirrordamage > 0 || mirrorforce > 0) { attacker = attacker_save;