From da52bac304b52a145d793604d44150542b4f0385 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Tue, 6 Sep 2016 02:15:34 +0000 Subject: [PATCH] Fix a bug in r5826 regarding display of the WWII GI rocket launcher. git-svn-id: https://svn.eduke32.com/eduke32@5851 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/player.c | 34 +++++++++++---------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index e958fc4ee..1ad38594b 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -2069,28 +2069,6 @@ static int P_DisplayAccess(int accessShade) static int32_t fistPos; -void P_WW2GIDisplayWeapon(DukePlayer_t * const pPlayer, int weaponNum, int *weaponYOffset) -{ - const uint8_t *const weaponFrame = &pPlayer->kickback_pic; - - switch (weaponNum) - { - case RPG_WEAPON: - { - int const totalTime = PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime); - if (*weaponFrame >= totalTime) - { - int const reloadTime = PWEAPON(screenpeek, pPlayer->curr_weapon, Reload); - - *weaponYOffset -= (*weaponFrame < ((reloadTime - totalTime) / 2 + totalTime)) - ? 10 * ((*weaponFrame) - totalTime) // down - : *weaponYOffset -= 10 * (reloadTime - (*weaponFrame)); // up - } - } - break; - } -} - void P_DisplayWeapon(void) { DukePlayer_t *const pPlayer = g_player[screenpeek].ps; @@ -2247,7 +2225,17 @@ void P_DisplayWeapon(void) G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 164, (weaponY << 1) + 176 - weaponYOffset, RPGGUN + ((*weaponFrame) >> 1), weaponShade, weaponBits, weaponPal, 0); else if (WW2GI) - P_WW2GIDisplayWeapon(pPlayer, currentWeapon, &weaponYOffset); + { + int const totalTime = PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime); + if (*weaponFrame >= totalTime) + { + int const reloadTime = PWEAPON(screenpeek, pPlayer->curr_weapon, Reload); + + weaponYOffset -= (*weaponFrame < ((reloadTime - totalTime) / 2 + totalTime)) + ? 10 * ((*weaponFrame) - totalTime) // down + : 10 * (reloadTime - (*weaponFrame)); // up + } + } } G_DrawWeaponTileWithID(currentWeapon, weaponX + 164, (weaponY << 1) + 176 - weaponYOffset, RPGGUN, weaponShade,