From c66c750547c95adebcdc51946923d99a31f37e9a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 Aug 2022 16:47:27 +0200 Subject: [PATCH] - handle all constant add_int_z calls in Exhumed --- source/games/exhumed/src/bullet.cpp | 2 +- source/games/exhumed/src/fish.cpp | 2 +- source/games/exhumed/src/object.cpp | 4 ++-- source/games/exhumed/src/player.cpp | 2 +- source/games/exhumed/src/queen.cpp | 2 +- source/games/exhumed/src/view.cpp | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index 3b7fd7290..7a107a1a5 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -355,7 +355,7 @@ int MoveBullet(int nBullet) pActor->spr.xrepeat = 40; pActor->spr.yrepeat = 40; pActor->spr.shade = 0; - pActor->add_int_z(512); + pActor->spr.pos.Z += 2; } } else diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index f19072c2d..0772ad56a 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -102,7 +102,7 @@ void AIFishLimb::Tick(RunListEvent* ev) if (FloorZ <= pActor->int_pos().Z) { - pActor->add_int_z(256); + pActor->spr.pos.Z++; if ((pActor->int_pos().Z - FloorZ) > 25600) { diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index b348d36d9..7f6209da7 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -1768,13 +1768,13 @@ void AIEnergyBlock::RadialDamage(RunListEvent* ev) int nFloorZ = pSector->int_floorz(); pSector->set_int_floorz(pActor->int_pos().Z); - pActor->add_int_z(-256); + pActor->spr.pos.Z--; ev->nDamage = runlist_CheckRadialDamage(pActor); // restore previous values pSector->set_int_floorz(nFloorZ); - pActor->add_int_z(256); + pActor->spr.pos.Z++; if (ev->nDamage <= 0) { return; diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 753a55c5d..e777cf7ea 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -2493,7 +2493,7 @@ sectdone: PlayerList[nPlayer].nSeqSize = SeqSize[var_AC] - 1; if (pPlayerActor->int_pos().Z < pPlayerActor->sector()->int_floorz()) { - pPlayerActor->add_int_z(256); + pPlayerActor->spr.pos.Z++; } if (!RandomSize(5)) diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index c1c76feef..168461dd6 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -855,7 +855,7 @@ void AIQueenHead::Tick(RunListEvent* ev) } else { - pActor->add_int_z(-2048); + pActor->spr.pos.Z -= 8; goto __MOVEQS; } break; diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index f0e888aaa..fc6548484 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -109,8 +109,8 @@ static void analyzesprites(tspriteArray& tsprites, int x, int y, int z, double c if ((pTSprite->picnum == kTorch1 || pTSprite->picnum == kTorch2) && (pTSprite->cstat & CSTAT_SPRITE_YCENTER) == 0) { pTSprite->cstat |= CSTAT_SPRITE_YCENTER; - int nTileY = (tileHeight(pTSprite->picnum) * pTSprite->yrepeat) * 2; - pTSprite->add_int_z(-nTileY); + double nTileY = (tileHeight(pTSprite->picnum) * pTSprite->yrepeat) * 2 * zinttoworld; + pTSprite->pos.Z -= nTileY; } if (pTSprite->pal == 4 && pTSprite->shade >= numshades) pTSprite->shade = numshades - 1;