]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/damage.qc
weapon independency fixes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / damage.qc
index d0b3a288fb3011d5472d1d5df49a2d58ea217399..db9ddd0d9bd70c35034c7b933816561e330d63fd 100644 (file)
@@ -628,11 +628,19 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
                if(deathtype != DEATH_TELEFRAG.m_id)
                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)
+                       {
+                               damage = 0;
+                               force = '0 0 0';
+                       }
                        else if(!STAT(FROZEN, targ) && SAME_TEAM(attacker, targ))
                        {
                                if(autocvar_teamplay_mode == 1)