]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
improve collision handling when dropping in battle royale
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Thu, 27 Jan 2022 03:07:45 +0000 (04:07 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Thu, 27 Jan 2022 03:07:45 +0000 (04:07 +0100)
qcsrc/common/gamemodes/gamemode/br/sv_br.qc

index 3d08394378b48ffc6f98fee57ddaa3161ce09cc7..bb69ed7001ac92ffdc68fd7b0d04177e4b983fd3 100644 (file)
@@ -488,6 +488,8 @@ MUTATOR_HOOKFUNCTION(br, PM_Physics)
             bool player_is_drop_leader = has_drop_leader && (player == player.br_squad.br_squad_drop_leader);
             if(player_is_drop_leader || !has_drop_leader)
             {
+                player.br_drop_velocity = eZ * player.br_drop_velocity.z + vec2(player.velocity); // use real horizontal velocity in case of collisions
+
                 const float vertical_max = 0.9;
                 float maxairspeed = PHYS_MAXAIRSPEED(player) * max(maxspeed_mod, 1);
                 float maxdropspeed = maxairspeed * max(autocvar_g_br_drop_speed_max, 0);