From: drjaska Date: Mon, 30 May 2022 02:36:56 +0000 (+0300) Subject: fix if else branching logic X-Git-Tag: xonotic-v0.8.5~23^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=12061b78729bdc851453ee6fb1770184c4b41448;p=xonotic%2Fxonotic-data.pk3dir.git fix if else branching logic --- diff --git a/qcsrc/server/damage.qc b/qcsrc/server/damage.qc index db9ddd0d9..3cbc07c57 100644 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@ -629,14 +629,9 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de if(IS_PLAYER(attacker)) { // avoid dealing damage or force to other independent players - if(IS_PLAYER(targ) && targ != attacker && (IS_INDEPENDENT_PLAYER(attacker) || IS_INDEPENDENT_PLAYER(targ))) - { - damage = 0; - force = '0 0 0'; - } - // avoid dealing damage or force to things owned by other independent players - if(targ.realowner) - if(IS_INDEPENDENT_PLAYER(targ.realowner) && attacker != targ.realowner) + // and avoid dealing damage or force to things owned by other independent players + if((IS_PLAYER(targ) && targ != attacker && (IS_INDEPENDENT_PLAYER(attacker) || IS_INDEPENDENT_PLAYER(targ))) || + (targ.realowner && IS_INDEPENDENT_PLAYER(targ.realowner) && attacker != targ.realowner)) { damage = 0; force = '0 0 0';