From 81f85ee48044875b109587acf32738db514b9674 Mon Sep 17 00:00:00 2001 From: Evan Ramos Date: Mon, 10 Aug 2020 22:35:09 -0500 Subject: [PATCH] SW: Fix regression causing the last heat seeker to be a normal missile It was caused by the fix for crashing when firing outside the map. Also port said fix to the bunny rockets. --- source/sw/src/weapon.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/source/sw/src/weapon.cpp b/source/sw/src/weapon.cpp index f869529de..a887841c9 100644 --- a/source/sw/src/weapon.cpp +++ b/source/sw/src/weapon.cpp @@ -15428,7 +15428,8 @@ InitRocket(PLAYERp pp) DoPlayerBeginRecoil(pp, ROCKET_RECOIL_AMT); PlayerUpdateAmmo(pp, u->WeaponNum, -1); - if (pp->WpnRocketHeat) + auto const WpnRocketHeat = pp->WpnRocketHeat; + if (WpnRocketHeat) { switch (pp->WpnRocketType) { @@ -15482,7 +15483,7 @@ InitRocket(PLAYERp pp) // Set default palette wp->pal = wu->spal = 17; // White - if (pp->WpnRocketHeat) + if (WpnRocketHeat) { switch (pp->WpnRocketType) { @@ -15561,6 +15562,16 @@ InitBunnyRocket(PLAYERp pp) DoPlayerBeginRecoil(pp, ROCKET_RECOIL_AMT); PlayerUpdateAmmo(pp, u->WeaponNum, -1); + auto const WpnRocketHeat = pp->WpnRocketHeat; + if (WpnRocketHeat) + { + switch (pp->WpnRocketType) + { + case 1: + pp->WpnRocketHeat--; + break; + } + } PlaySound(DIGI_BUNNYATTACK, pp, v3df_dontpan|v3df_doppler); @@ -15601,13 +15612,13 @@ InitBunnyRocket(PLAYERp pp) SET(wp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); SET(wu->Flags, SPR_XFLIP_TOGGLE); - if (pp->WpnRocketHeat) + if (WpnRocketHeat) { switch (pp->WpnRocketType) { case 1: - pp->WpnRocketHeat--; SET(wu->Flags, SPR_FIND_PLAYER); + break; } }