- 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:
Mitchell Richters 2023-04-27 22:33:42 +10:00
parent 78df82e1ed
commit adbd5c3c69

View file

@ -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)
{