From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Fri, 28 Jan 2022 05:43:34 +0000 (+0100) Subject: knocked down players in battle royale can't swim X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=07495a02e749b4ad6ecec5dc35e378157e9028b2;p=xonotic%2Fxonotic-data.pk3dir.git knocked down players in battle royale can't swim --- diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc index a6d466356..b50d751c0 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc @@ -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)