From 1d75fa13a45a78120b99a9ce511f998fa73b1643 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 2 May 2018 07:12:55 +0000 Subject: [PATCH] WWII GI: Fix mistakes in our version of the weapon display code. git-svn-id: https://svn.eduke32.com/eduke32@6869 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/player.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index f9d373460..46cd949fc 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -2239,15 +2239,12 @@ void P_DisplayWeapon(void) RPGGUN + ((*weaponFrame) >> 1), weaponShade, weaponBits, weaponPal); else if (WW2GI) { - int const totalTime = PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime); - if (*weaponFrame >= totalTime) - { - int const reloadTime = PWEAPON(screenpeek, pPlayer->curr_weapon, Reload); + int const totalTime = 8; // not what WW2GI.EXE reports, not in the source, but apparently necessary! + int const reloadTime = PWEAPON(screenpeek, pPlayer->curr_weapon, Reload); - weaponYOffset -= (*weaponFrame < ((reloadTime - totalTime) / 2 + totalTime)) - ? 10 * ((*weaponFrame) - totalTime) // down - : 10 * (reloadTime - (*weaponFrame)); // up - } + weaponYOffset -= (*weaponFrame < ((reloadTime - totalTime) / 2 + totalTime)) + ? 10 * ((*weaponFrame) - totalTime) // down + : 10 * (reloadTime - (*weaponFrame)); // up } } @@ -2770,9 +2767,12 @@ void P_DisplayWeapon(void) } } // else we are in 'reload time' - weaponYOffset -= (*weaponFrame < ((reloadTime - totalTime) / 2 + totalTime)) - ? (currentWeapon == GROW_WEAPON ? 5 : 10) * ((*weaponFrame) - totalTime) // D - : 10 * (reloadTime - (*weaponFrame)); // U + else + { + weaponYOffset -= (*weaponFrame < ((reloadTime - totalTime) / 2 + totalTime)) + ? (currentWeapon == GROW_WEAPON ? 5 : 10) * ((*weaponFrame) - totalTime) // D + : 10 * (reloadTime - (*weaponFrame)); // U + } } G_DrawWeaponTileUnfadedWithID(currentWeapon << 1, weaponX + 184 - halfLookAng, weaponY + 240 - weaponYOffset,