mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
Fixed BlockingLine giving erroneous results
Fixed BlockingLine not clearing properly when xy velocity is 0
This commit is contained in:
parent
0149940a2a
commit
0cbbaece3b
1 changed files with 6 additions and 1 deletions
|
@ -1971,6 +1971,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
|
||||||
FCheckPosition tm(!!(mo->flags2 & MF2_RIP));
|
FCheckPosition tm(!!(mo->flags2 & MF2_RIP));
|
||||||
|
|
||||||
DAngle oldangle = mo->Angles.Yaw;
|
DAngle oldangle = mo->Angles.Yaw;
|
||||||
|
line_t* blocker = nullptr;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (mo->Level->i_compatflags & COMPATF_WALLRUN) pushtime++;
|
if (mo->Level->i_compatflags & COMPATF_WALLRUN) pushtime++;
|
||||||
|
@ -1986,7 +1987,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
|
||||||
{
|
{
|
||||||
// blocked move
|
// blocked move
|
||||||
AActor *BlockingMobj = mo->BlockingMobj;
|
AActor *BlockingMobj = mo->BlockingMobj;
|
||||||
line_t *BlockingLine = mo->BlockingLine;
|
line_t *BlockingLine = blocker = mo->BlockingLine;
|
||||||
|
|
||||||
// [ZZ]
|
// [ZZ]
|
||||||
if (!BlockingLine && !BlockingMobj) // hit floor or ceiling while XY movement - sector actions
|
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);
|
} while (++step <= steps);
|
||||||
|
|
||||||
|
// Correctly update whether the Actor was truly blocked by a wall or not
|
||||||
|
mo->BlockingLine = blocker;
|
||||||
|
|
||||||
// Friction
|
// Friction
|
||||||
|
|
||||||
if (player && player->mo == mo && player->cheats & CF_NOVELOCITY)
|
if (player && player->mo == mo && player->cheats & CF_NOVELOCITY)
|
||||||
|
@ -4057,6 +4061,7 @@ void AActor::Tick ()
|
||||||
|
|
||||||
// Handle X and Y velocities
|
// Handle X and Y velocities
|
||||||
BlockingMobj = nullptr;
|
BlockingMobj = nullptr;
|
||||||
|
BlockingLine = nullptr;
|
||||||
sector_t* oldBlockingCeiling = BlockingCeiling;
|
sector_t* oldBlockingCeiling = BlockingCeiling;
|
||||||
sector_t* oldBlockingFloor = BlockingFloor;
|
sector_t* oldBlockingFloor = BlockingFloor;
|
||||||
Blocking3DFloor = nullptr;
|
Blocking3DFloor = nullptr;
|
||||||
|
|
Loading…
Reference in a new issue