From 4e15b11571323fb818c8cc4f60db2742c2809cc7 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 17 Sep 2019 03:20:42 +0000 Subject: [PATCH] Remove getzsofslope_player() and use yax_getzsofslope() and getcorrectzsofslope() to determine the player's .truecz and .truefz values git-svn-id: https://svn.eduke32.com/eduke32@8110 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/player.cpp | 47 ++---------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index f042cfc3b..a28ba150d 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -4424,49 +4424,6 @@ static int P_DoFist(DukePlayer_t *pPlayer) return 0; } -#ifdef YAX_ENABLE -static void getzsofslope_player(int sectNum, int playerX, int playerY, int32_t *pCeilZ, int32_t *pFloorZ) -{ - int didCeiling = 0; - - if ((sector[sectNum].ceilingstat & 512) == 0) - { - int const neighborSect = yax_getneighborsect(playerX, playerY, sectNum, YAX_CEILING); - - if (neighborSect >= 0) - { - *pCeilZ = getceilzofslope(neighborSect, playerX, playerY); - didCeiling = 1; - } - } - - int didFloor = 0; - - if ((sector[sectNum].floorstat & 512) == 0) - { - int const neighborSect = yax_getneighborsect(playerX, playerY, sectNum, YAX_FLOOR); - - if (neighborSect >= 0) - { - *pFloorZ = getflorzofslope(neighborSect, playerX, playerY); - didFloor = 1; - } - } - - if (!didCeiling || !didFloor) - { - int32_t ceilingZ, floorZ; - getzsofslope(sectNum, playerX, playerY, &ceilingZ, &floorZ); - - if (!didCeiling) - *pCeilZ = ceilingZ; - - if (!didFloor) - *pFloorZ = floorZ; - } -} -#endif - void P_UpdatePosWhenViewingCam(DukePlayer_t *pPlayer) { int const newOwner = pPlayer->newowner; @@ -4743,9 +4700,9 @@ void P_ProcessInput(int playerNum) pPlayer->sbs = 0; #ifdef YAX_ENABLE - getzsofslope_player(pPlayer->cursectnum, pPlayer->pos.x, pPlayer->pos.y, &pPlayer->truecz, &pPlayer->truefz); + yax_getzsofslope(pPlayer->cursectnum, pPlayer->pos.x, pPlayer->pos.y, &pPlayer->truecz, &pPlayer->truefz); #else - getzsofslope(pPlayer->cursectnum, pPlayer->pos.x, pPlayer->pos.y, &pPlayer->truecz, &pPlayer->truefz); + getcorrectzsofslope(pPlayer->cursectnum, pPlayer->pos.x, pPlayer->pos.y, &pPlayer->truecz, &pPlayer->truefz); #endif int const trueFloorZ = pPlayer->truefz; int const trueFloorDist = klabs(pPlayer->pos.z - trueFloorZ);