mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Merge branch 'flipped-waterrun' into 'next'
Allow water running in reverse gravity See merge request STJr/SRB2!1369
This commit is contained in:
commit
ea55a614d1
1 changed files with 6 additions and 3 deletions
|
@ -3188,13 +3188,16 @@ boolean P_SceneryZMovement(mobj_t *mo)
|
||||||
//
|
//
|
||||||
boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
|
boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
|
||||||
{
|
{
|
||||||
fixed_t topheight = P_GetFFloorTopZAt(rover, player->mo->x, player->mo->y);
|
boolean flip = player->mo->eflags & MFE_VERTICALFLIP;
|
||||||
|
fixed_t surfaceheight = flip ? P_GetFFloorBottomZAt(rover, player->mo->x, player->mo->y) : P_GetFFloorTopZAt(rover, player->mo->x, player->mo->y);
|
||||||
|
fixed_t playerbottom = flip ? (player->mo->z + player->mo->height) : player->mo->z;
|
||||||
|
boolean doifit = flip ? (surfaceheight - player->mo->floorz >= player->mo->height) : (player->mo->ceilingz - surfaceheight >= player->mo->height);
|
||||||
|
|
||||||
if (!player->powers[pw_carry] && !player->homing
|
if (!player->powers[pw_carry] && !player->homing
|
||||||
&& ((player->powers[pw_super] || player->charflags & SF_RUNONWATER || player->dashmode >= DASHMODE_THRESHOLD) && player->mo->ceilingz-topheight >= player->mo->height)
|
&& ((player->powers[pw_super] || player->charflags & SF_RUNONWATER || player->dashmode >= DASHMODE_THRESHOLD) && doifit)
|
||||||
&& (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale)
|
&& (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale)
|
||||||
&& !(player->pflags & PF_SLIDING)
|
&& !(player->pflags & PF_SLIDING)
|
||||||
&& abs(player->mo->z - topheight) < FixedMul(30*FRACUNIT, player->mo->scale))
|
&& abs(playerbottom - surfaceheight) < FixedMul(30*FRACUNIT, player->mo->scale))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue