mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 04:01:31 +00:00
fix floorclipping on slopes.
This commit is contained in:
parent
d58fa05a5f
commit
c42b51d5eb
1 changed files with 11 additions and 2 deletions
|
@ -628,9 +628,14 @@ static int P_Move (AActor *actor)
|
|||
// actually walking down a step.
|
||||
if (try_ok &&
|
||||
!((actor->flags & MF_NOGRAVITY) || CanJump(actor))
|
||||
&& actor->Z() > actor->floorz && !(actor->flags2 & MF2_ONMOBJ))
|
||||
&& !(actor->flags2 & MF2_ONMOBJ))
|
||||
|
||||
{
|
||||
if (actor->Z() <= actor->floorz + actor->MaxStepHeight)
|
||||
// account for imprecisions with slopes. A walking actor should never be below its own floorz.
|
||||
if (actor->Z() < actor->floorz)
|
||||
actor->SetZ(actor->floorz);
|
||||
|
||||
else if (actor->Z() <= actor->floorz + actor->MaxStepHeight)
|
||||
{
|
||||
double savedz = actor->Z();
|
||||
actor->SetZ(actor->floorz);
|
||||
|
@ -755,6 +760,10 @@ int P_SmartMove(AActor* actor)
|
|||
)
|
||||
actor->movedir = DI_NODIR; // avoid the area (most of the time anyway)
|
||||
|
||||
if (actor->flags2 & MF2_FLOORCLIP)
|
||||
{
|
||||
actor->AdjustFloorClip();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue