mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 01:02:03 +00:00
- Change the time when walking monsters step down steps to just after the step rather than just before.
This allows for thrusting walking monsters vertically without them suddenly warping to the ground. SVN r2819 (trunk)
This commit is contained in:
parent
5871712fd4
commit
eb031d73e7
1 changed files with 24 additions and 10 deletions
|
@ -427,20 +427,14 @@ bool P_Move (AActor *actor)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// [RH] Instead of yanking non-floating monsters to the ground,
|
// [RH] Walking actors that are not on the ground cannot walk. We don't
|
||||||
// let gravity drop them down, unless they're moving down a step.
|
// want to yank them to the ground here as Doom did, since that makes
|
||||||
|
// it difficult ot thrust them vertically in a reasonable manner.
|
||||||
// [GZ] Let jumping actors jump.
|
// [GZ] Let jumping actors jump.
|
||||||
if (!((actor->flags & MF_NOGRAVITY) || (actor->flags6 & MF6_CANJUMP))
|
if (!((actor->flags & MF_NOGRAVITY) || (actor->flags6 & MF6_CANJUMP))
|
||||||
&& actor->z > actor->floorz && !(actor->flags2 & MF2_ONMOBJ))
|
&& actor->z > actor->floorz && !(actor->flags2 & MF2_ONMOBJ))
|
||||||
{
|
{
|
||||||
if (actor->z > actor->floorz + actor->MaxStepHeight)
|
return false;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
actor->z = actor->floorz;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((unsigned)actor->movedir >= 8)
|
if ((unsigned)actor->movedir >= 8)
|
||||||
|
@ -537,6 +531,26 @@ bool P_Move (AActor *actor)
|
||||||
actor->vely += FixedMul (deltay, movefactor);
|
actor->vely += FixedMul (deltay, movefactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [RH] If a walking monster is no longer on the floor, move it down
|
||||||
|
// to the floor if it is within MaxStepHeight, presuming that it is
|
||||||
|
// actually walking down a step.
|
||||||
|
if (try_ok &&
|
||||||
|
!((actor->flags & MF_NOGRAVITY) || (actor->flags6 & MF6_CANJUMP))
|
||||||
|
&& actor->z > actor->floorz && !(actor->flags2 & MF2_ONMOBJ))
|
||||||
|
{
|
||||||
|
if (actor->z <= actor->floorz + actor->MaxStepHeight)
|
||||||
|
{
|
||||||
|
fixed_t savedz = actor->z;
|
||||||
|
actor->z = actor->floorz;
|
||||||
|
// Make sure that there isn't some other actor between us and
|
||||||
|
// the floor we could get stuck in. The old code did not do this.
|
||||||
|
if (!P_TestMobjZ(actor))
|
||||||
|
{
|
||||||
|
actor->z = savedz;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!try_ok)
|
if (!try_ok)
|
||||||
{
|
{
|
||||||
if (((actor->flags6 & MF6_CANJUMP)||(actor->flags & MF_FLOAT)) && tm.floatok)
|
if (((actor->flags6 & MF6_CANJUMP)||(actor->flags & MF_FLOAT)) && tm.floatok)
|
||||||
|
|
Loading…
Reference in a new issue