mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-22 17:01:08 +00:00
- Exhumed: Fix velocity loss in movespritez()
when warping.
* Old code was adjusting the actor's Z to right off the ceiling with no factoring in of the old interpolation position. * Due to this, we were hitting the `nCamerapos.Z = min(max(nCamerapos.Z, pSector->ceilingz + 1), pSector->floorz - 1);` bounding in the draw code. * Since game puts you right at the ceiling, we apply this to the old interpolation position, as well as the current position, however we then add their velocity back onto the current position to make the warp seamless.
This commit is contained in:
parent
78df82e1ed
commit
adbd5c3c69
1 changed files with 6 additions and 1 deletions
|
@ -374,8 +374,14 @@ Collision movespritez(DExhumedActor* pActor, double z, double height, double cli
|
|||
if ((destZ - height) < sprceiling && (hiHit.type == kHitSprite || pActor->sector()->pAbove == nullptr))
|
||||
{
|
||||
destZ = sprceiling + height;
|
||||
pActor->spr.pos.Z = pActor->opos.Z = destZ;
|
||||
pActor->spr.pos.Z += z;
|
||||
nRet.exbits |= kHitAux1;
|
||||
}
|
||||
else
|
||||
{
|
||||
pActor->spr.pos.Z = destZ;
|
||||
}
|
||||
}
|
||||
|
||||
if (spriteZ <= floorZ && destZ > floorZ)
|
||||
|
@ -387,7 +393,6 @@ Collision movespritez(DExhumedActor* pActor, double z, double height, double cli
|
|||
}
|
||||
|
||||
pActor->spr.cstat = cstat; // restore cstat
|
||||
pActor->spr.pos.Z = destZ;
|
||||
|
||||
if (pActor->spr.statnum == 100)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue