Fix up dash direction when using noclip2.

This commit is contained in:
Mari the Deer 2021-03-19 18:54:42 +01:00
commit da2a20d62b
2 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r373 \cu(Fri 19 Mar 18:43:47 CET 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r373 \cu(2021-03-19 18:43:48)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r374 \cu(Fri 19 Mar 18:54:42 CET 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r374 \cu(2021-03-19 18:54:42)\c-";

View file

@ -1573,9 +1573,16 @@ Class Demolitionist : PlayerPawn
if ( fm ) dodge += (fm>0)?X:-X;
if ( sm ) dodge += (sm>0)?Y:-Y;
if ( player.cmd.buttons&BT_CROUCH ) dodge = (0,0,-1); // death from above
if ( dodge == (0,0,0) ) dodge.xy = RotateVector((1,0),angle);
if ( !level.IsJumpingAllowed() ) dodge.z = min(0,dodge.z);
if ( player.onground ) dodge.z = max(0,dodge.z);
if ( dodge == (0,0,0) )
{
if ( !player.onground || bNOGRAVITY || (waterlevel > 2) || (player.cheats&CF_NOCLIP2) ) dodge = X;
else dodge.xy = RotateVector((1,0),angle);
}
if ( player.onground && !bNOGRAVITY && (waterlevel < 2) && !(player.cheats&CF_NOCLIP2) )
{
dodge.z = max(0,dodge.z);
if ( !level.IsJumpingAllowed() ) dodge.z = min(0,dodge.z);
}
if ( (dodge.length() > 0) && (dashcooldown <= 0) && (dashfuel > 20.) && player.cmd.buttons&BT_USER2 && (player.onground || level.IsJumpingAllowed() || (player.cmd.buttons&BT_CROUCH)) && (gamestate == GS_LEVEL) )
{
dashdir = dodge.unit();