From 6d57adc8c33bec207bb0c8e76be09dd97e0a8afc Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 24 May 2020 11:18:23 +0200 Subject: [PATCH] Improve physics in water when frozen --- qcsrc/ecs/systems/physics.qc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/ecs/systems/physics.qc b/qcsrc/ecs/systems/physics.qc index fb0781e49..75657c90f 100644 --- a/qcsrc/ecs/systems/physics.qc +++ b/qcsrc/ecs/systems/physics.qc @@ -220,8 +220,10 @@ void sys_phys_simulate(entity this, float dt) if (this.com_phys_water) { if (PHYS_FROZEN(this)) { - if(this.waterlevel >= WATERLEVEL_SUBMERGED) + if(this.waterlevel >= WATERLEVEL_SUBMERGED && this.velocity.z >= -70) // don't change the speed too abruptally wishvel = '0 0 160'; // resurface + else if(this.waterlevel >= WATERLEVEL_SWIMMING && this.velocity.z > 0) + wishvel = eZ * 1.3 * min(this.velocity.z, 160); // resurface a bit more above the surface } else { -- 2.39.2