]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Prevent independent players from claiming some objectives
authorMario <mario.mario@y7mail.com>
Fri, 26 Jul 2024 02:07:12 +0000 (12:07 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 26 Jul 2024 02:07:12 +0000 (12:07 +1000)
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc
qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc
qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc
qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc

index 16130f086efe50d3fd9062d6b3c65239c58cd5fa..e6554964a3636b98a164778bae9efc3b692bfac0 100644 (file)
@@ -1125,7 +1125,8 @@ METHOD(Flag, giveTo, bool(Flag this, entity flag, entity toucher))
        }
 
        // special touch behaviors
-       if(STAT(FROZEN, toucher)) { return; }
+       if(IS_INDEPENDENT_PLAYER(toucher)) { return; }
+       else if(STAT(FROZEN, toucher)) { return; }
        else if(IS_VEHICLE(toucher))
        {
                if(autocvar_g_ctf_allow_vehicle_touch && toucher.owner)
@@ -2388,7 +2389,7 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey)
 
                        while(head) // find the closest acceptable target to pass to
                        {
-                               if(IS_PLAYER(head) && !IS_DEAD(head))
+                               if(IS_PLAYER(head) && !IS_DEAD(head) && !IS_INDEPENDENT_PLAYER(head))
                                if(head != player && SAME_TEAM(head, player))
                                if(!head.speedrunning && !head.vehicle)
                                {
index e245ff92faf92d106c613493b8df1e49824b5375..91e78dda44eb521e77aa25737a75e2b18c367379 100644 (file)
@@ -198,7 +198,9 @@ void dompointtouch(entity this, entity toucher)
 {
        if(!IS_PLAYER(toucher))
                return;
-       if(GetResource(toucher, RES_HEALTH) < 1)
+       if(IS_DEAD(toucher))
+               return;
+       if(IS_INDEPENDENT_PLAYER(toucher))
                return;
 
        if(round_handler_IsActive() && !round_handler_IsRoundStarted())
index 4ba23b197955ca4efdecb6d9ad06a23a178486d1..9f694a0e09d55895fe0765330e9c2cc1430347de 100644 (file)
@@ -115,6 +115,7 @@ void ka_TouchEvent(entity this, entity toucher) // runs any time that the ball c
                return;
        }
        if(toucher.ballcarried) { return; }
+       if(IS_INDEPENDENT_PLAYER(toucher)) { return; }
        if(IS_DEAD(toucher)) { return; }
        if(STAT(FROZEN, toucher)) { return; }
        if (!IS_PLAYER(toucher))
index beb5cd7f40f6d75a459466a132ae27eb571e0a95..15024ed88d9153780bcb103a26fb6899ad094e2b 100644 (file)
@@ -455,6 +455,8 @@ void kh_Key_Touch(entity this, entity toucher)  // runs many, many times when a
                return;
        if(IS_DEAD(toucher))
                return;
+       if(IS_INDEPENDENT_PLAYER(toucher))
+               return;
        if(toucher == this.enemy)
                if(time < this.kh_droptime + autocvar_g_balance_keyhunt_delay_collect)
                        return;  // you just dropped it!
index 507d31750599f1182ca7d14fbd9a2e72a23a6d08..0935b9709aed2d0c25df12b6a1a10ccd38d3b9ba 100644 (file)
@@ -92,6 +92,7 @@ void tka_TouchEvent(entity this, entity toucher) // runs any time that the ball
                return;
        }
        if(toucher.ballcarried) { return; }
+       if(IS_INDEPENDENT_PLAYER(toucher)) { return; }
        if(IS_DEAD(toucher)) { return; }
        if(STAT(FROZEN, toucher)) { return; }
        if (!IS_PLAYER(toucher))