From: Samual Date: Fri, 30 Sep 2011 14:31:50 +0000 (-0400) Subject: Fix a bug with g_projectiles_damage 1 X-Git-Tag: xonotic-v0.6.0~40^2~92^2~1^2~25 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4392597c2f40c3db2cd470d3411e0a7a292adf28;p=xonotic%2Fxonotic-data.pk3dir.git Fix a bug with g_projectiles_damage 1 --- diff --git a/qcsrc/server/w_common.qc b/qcsrc/server/w_common.qc index dfd5c77b6..4ba9990f4 100644 --- a/qcsrc/server/w_common.qc +++ b/qcsrc/server/w_common.qc @@ -546,20 +546,29 @@ float W_CheckProjectileDamage(entity inflictor, entity projowner, float deathtyp float is_from_contents = (deathtype == DEATH_SLIME || deathtype == DEATH_LAVA); float is_from_owner = (inflictor == projowner); + print(strcat("from_contents ", ftos(is_from_contents), " : from_owner ", ftos(is_from_owner), " : exception ", ftos(exception), ". \n")); + + + if(autocvar_g_projectiles_damage <= -2) - return FALSE; // no damage to projectiles at all, not even with the exceptions - + { + return FALSE; // no damage to projectiles at all, not even with the exceptions + } else if(autocvar_g_projectiles_damage == -1) + { if not(exception) return FALSE; // no damage other than exceptions (electro combo, hagar join explode, minelayer mines) - + } else if(autocvar_g_projectiles_damage == 0) + { if not(is_from_contents || exception) return FALSE; // only damage from contents or exceptions is allowed - + } else if(autocvar_g_projectiles_damage == 1) + { if not(is_from_contents || is_from_owner || exception) return FALSE; // only self damage or damage from contents or exceptions is allowed + } // -2 or lower disables all damage including exceptions // 2 or higher automatically allows all damage normally