]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
knocked down players in battle royale can't swim
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Fri, 28 Jan 2022 05:43:34 +0000 (06:43 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Fri, 28 Jan 2022 05:43:34 +0000 (06:43 +0100)
qcsrc/common/gamemodes/gamemode/br/sv_br.qc

index a6d466356e542f15d66de640ba9357b336c1182b..b50d751c06edfff663cebd14ef1055f41c566029 100644 (file)
@@ -602,6 +602,16 @@ MUTATOR_HOOKFUNCTION(br, PM_Physics)
             W_SwitchWeapon_Force(player, w_getbestweapon(player, weaponentity), weaponentity);
         }
     }
+
+    // injured players can't swim
+    if(STAT(BLEEDING, player)){
+        if(player.waterlevel >= WATERLEVEL_SWIMMING)
+        {
+            CS(player).movement.z = -60; // drift towards bottom
+            player.v_angle.x = 0;
+            player.com_in_jump = false;
+        }
+    }
 }
 
 MUTATOR_HOOKFUNCTION(br, Damage_Calculate)