mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Slow glide down underwater
This commit is contained in:
parent
22649f698e
commit
1306b2bbc5
1 changed files with 12 additions and 3 deletions
15
src/p_user.c
15
src/p_user.c
|
@ -5303,14 +5303,23 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
// Now Knuckles-type abilities are checked.
|
||||
if (!(player->pflags & PF_THOKKED) || player->charflags & SF_MULTIABILITY)
|
||||
{
|
||||
INT32 glidespeed = player->actionspd;
|
||||
fixed_t glidespeed = FixedMul(player->actionspd, player->mo->scale);
|
||||
fixed_t playerspeed = player->speed;
|
||||
|
||||
if (player->mo->eflags & MFE_UNDERWATER)
|
||||
{
|
||||
glidespeed >>= 1;
|
||||
playerspeed >>= 1;
|
||||
player->mo->momx = ((player->mo->momx - player->cmomx) >> 1) + player->cmomx;
|
||||
player->mo->momy = ((player->mo->momy - player->cmomy) >> 1) + player->cmomy;
|
||||
}
|
||||
|
||||
player->pflags |= PF_GLIDING|PF_THOKKED;
|
||||
player->glidetime = 0;
|
||||
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE);
|
||||
if (player->speed < glidespeed)
|
||||
P_Thrust(player->mo, player->mo->angle, glidespeed - player->speed);
|
||||
if (playerspeed < glidespeed)
|
||||
P_Thrust(player->mo, player->mo->angle, glidespeed - playerspeed);
|
||||
player->pflags &= ~(PF_SPINNING|PF_STARTDASH);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue