]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
stop dropping when hitting water
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Thu, 27 Jan 2022 03:25:26 +0000 (04:25 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Thu, 27 Jan 2022 03:25:26 +0000 (04:25 +0100)
qcsrc/common/gamemodes/gamemode/br/sv_br.qc

index bb69ed7001ac92ffdc68fd7b0d04177e4b983fd3..29e914bf1bae503360b5bd8941e1cca5a0e6c58e 100644 (file)
@@ -481,7 +481,7 @@ MUTATOR_HOOKFUNCTION(br, PM_Physics)
 
     // TODO: improve dropping physics
     if(STAT(DROP, player) == DROP_FALLING){
-        if(!IS_ONGROUND(player) && ((tracebox(player.origin, player.mins, player.maxs, player.origin - '0 0 1', MOVE_NOMONSTERS, player), trace_fraction) >= 1)) // IS_ONGROUND doesn't work if jump is held (jump is theoretically blocked until landed)
+        if(!IS_ONGROUND(player) && (player.waterlevel < WATERLEVEL_SWIMMING) && ((tracebox(player.origin, player.mins, player.maxs, player.origin - '0 0 1', MOVE_NOMONSTERS, player), trace_fraction) >= 1)) // IS_ONGROUND doesn't work if jump is held (jump is theoretically blocked until landed)
         {
             ITEMS_STAT(player) |= IT_USING_JETPACK;
             bool has_drop_leader = IN_SQUAD(player) && (player.br_drop_detached != 2) && (player.br_squad.br_squad_drop_leader && (STAT(DROP, player.br_squad.br_squad_drop_leader) == DROP_FALLING));