diff --git a/language.version b/language.version index c46566711..b2a01547f 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1090 \cu(Wed 17 Jan 12:39:00 CET 2024)\c-"; -SWWM_SHORTVER="\cw1.3pre r1090 \cu(2024-01-17 12:39:00)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1091 \cu(Wed 17 Jan 14:07:32 CET 2024)\c-"; +SWWM_SHORTVER="\cw1.3pre r1091 \cu(2024-01-17 14:07:32)\c-"; diff --git a/zscript/player/swwm_player_move.zsc b/zscript/player/swwm_player_move.zsc index c1d57bb9c..14cff8100 100644 --- a/zscript/player/swwm_player_move.zsc +++ b/zscript/player/swwm_player_move.zsc @@ -669,7 +669,7 @@ extend Class Demolitionist { double defaultheight = FullHeight; double savedheight = Height; - double crouchspeed = direction*CROUCHSPEED*.8; // slow down slightly so it matches the animation + double crouchspeed = direction*CROUCHSPEED*((direction>0)?.65:.9); // match animation speed double oldheight = player.viewheight; player.crouchdir = direction; player.crouchfactor += crouchspeed; diff --git a/zscript/player/swwm_player_tick.zsc b/zscript/player/swwm_player_tick.zsc index d191ae96f..79aa7ffec 100644 --- a/zscript/player/swwm_player_tick.zsc +++ b/zscript/player/swwm_player_tick.zsc @@ -193,7 +193,18 @@ extend Class Demolitionist PoisonDurationReceived = 0; PoisonPeriodReceived = 0; PoisonDamageReceived = 0; + double PrevHeight = Height; Super.Tick(); + double HeightDiff = Height-PrevHeight; + // shift vertically around center of gravity if crouching while airborne (crouch jumping) + if ( player && (player.mo == self) && CanCrouch() && (player.playerstate != PST_DEAD) && !player.onground && (abs(HeightDiff) > 0) ) + { + double oldz = pos.z; + SetZ(pos.z-HeightDiff*.5); + // note: even with this check, clipping through sloped 3D floors may still happen + // (honestly, sloped 3d floors are a source of many troubles) + if ( !TryMove(pos.xy,false) ) SetZ(oldz); + } if ( (gamestate != GS_LEVEL) || !player || (player.mo != self) || (freezetics > 0) ) return; UpdateFace(); UpdateTags();