Revert "- SW: Revert last commit and apply changes directly in pp->setHeightAndZ() so all bases are covered."

This reverts commit a643a74083.

* Fixes #795
This commit is contained in:
Mitchell Richters 2022-12-16 08:38:43 +11:00
parent 02814eaf1a
commit 8bbf7f4e00
3 changed files with 7 additions and 4 deletions

View file

@ -1888,7 +1888,7 @@ struct PLAYER
void setHeightAndZ(const double newz, const double newheight)
{
actor->spr.pos.Z = newz - newheight - actor->viewzoffset;
actor->spr.pos.Z = newz;
height = newheight;
}

View file

@ -3142,7 +3142,8 @@ void DoPlayerFall(PLAYER* pp)
// i any kind of crawl key get rid of recoil
if (DoPlayerTestCrawl(pp) || (pp->input.actions & SB_CROUCH))
{
pp->setHeightAndZ(pp->loz, PLAYER_CRAWL_HEIGHTF);
pp->actor->spr.pos.Z = pp->loz - PLAYER_CRAWL_HEIGHTF - pp->actor->viewzoffset;
pp->height = PLAYER_CRAWL_HEIGHTF;
}
else
{
@ -3605,7 +3606,8 @@ void DoPlayerCrawl(PLAYER* pp)
if (pp->insector() && (pp->cursector->extra & SECTFX_DYNAMIC_AREA))
{
pp->setHeightAndZ(pp->loz, PLAYER_CRAWL_HEIGHTF);
pp->actor->spr.pos.Z = pp->loz - PLAYER_CRAWL_HEIGHTF - pp->actor->viewzoffset;
pp->height = PLAYER_CRAWL_HEIGHTF;
}
DoPlayerBob(pp);

View file

@ -1743,7 +1743,8 @@ PlayerPart:
{
// move up some for really fast moving plats
DoPlayerZrange(pp);
pp->setHeightAndZ(pp->loz, PLAYER_CRAWL_HEIGHTF);
pp->actor->spr.pos.Z = pp->loz - PLAYER_CRAWL_HEIGHTF - pp->actor->viewzoffset;
pp->height = PLAYER_CRAWL_HEIGHTF;
}
else
{