Fixed BlockingLine giving erroneous results

Fixed BlockingLine not clearing properly when xy velocity is 0
This commit is contained in:
Boondorl 2023-01-19 11:44:57 -05:00 committed by Rachael Alexanderson
parent 0149940a2a
commit 0cbbaece3b

View file

@ -1971,6 +1971,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
FCheckPosition tm(!!(mo->flags2 & MF2_RIP));
DAngle oldangle = mo->Angles.Yaw;
line_t* blocker = nullptr;
do
{
if (mo->Level->i_compatflags & COMPATF_WALLRUN) pushtime++;
@ -1986,7 +1987,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
{
// blocked move
AActor *BlockingMobj = mo->BlockingMobj;
line_t *BlockingLine = mo->BlockingLine;
line_t *BlockingLine = blocker = mo->BlockingLine;
// [ZZ]
if (!BlockingLine && !BlockingMobj) // hit floor or ceiling while XY movement - sector actions
@ -2188,6 +2189,9 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
}
} while (++step <= steps);
// Correctly update whether the Actor was truly blocked by a wall or not
mo->BlockingLine = blocker;
// Friction
if (player && player->mo == mo && player->cheats & CF_NOVELOCITY)
@ -4057,6 +4061,7 @@ void AActor::Tick ()
// Handle X and Y velocities
BlockingMobj = nullptr;
BlockingLine = nullptr;
sector_t* oldBlockingCeiling = BlockingCeiling;
sector_t* oldBlockingFloor = BlockingFloor;
Blocking3DFloor = nullptr;