From 12061b78729bdc851453ee6fb1770184c4b41448 Mon Sep 17 00:00:00 2001 From: drjaska Date: Mon, 30 May 2022 05:36:56 +0300 Subject: [PATCH] fix if else branching logic --- qcsrc/server/damage.qc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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'; -- 2.39.2