From: terencehill Date: Sun, 24 May 2020 09:18:23 +0000 (+0200) Subject: Improve physics in water when frozen X-Git-Tag: xonotic-v0.8.5~1033^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6d57adc8c33bec207bb0c8e76be09dd97e0a8afc;p=xonotic%2Fxonotic-data.pk3dir.git Improve physics in water when frozen --- 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 {