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.
This commit is contained in:
Evan Ramos 2020-08-10 22:35:09 -05:00 committed by Christoph Oelckers
parent 09a3567f14
commit 81f85ee480

View file

@ -15428,7 +15428,8 @@ InitRocket(PLAYERp pp)
DoPlayerBeginRecoil(pp, ROCKET_RECOIL_AMT); DoPlayerBeginRecoil(pp, ROCKET_RECOIL_AMT);
PlayerUpdateAmmo(pp, u->WeaponNum, -1); PlayerUpdateAmmo(pp, u->WeaponNum, -1);
if (pp->WpnRocketHeat) auto const WpnRocketHeat = pp->WpnRocketHeat;
if (WpnRocketHeat)
{ {
switch (pp->WpnRocketType) switch (pp->WpnRocketType)
{ {
@ -15482,7 +15483,7 @@ InitRocket(PLAYERp pp)
// Set default palette // Set default palette
wp->pal = wu->spal = 17; // White wp->pal = wu->spal = 17; // White
if (pp->WpnRocketHeat) if (WpnRocketHeat)
{ {
switch (pp->WpnRocketType) switch (pp->WpnRocketType)
{ {
@ -15561,6 +15562,16 @@ InitBunnyRocket(PLAYERp pp)
DoPlayerBeginRecoil(pp, ROCKET_RECOIL_AMT); DoPlayerBeginRecoil(pp, ROCKET_RECOIL_AMT);
PlayerUpdateAmmo(pp, u->WeaponNum, -1); 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); 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(wp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
SET(wu->Flags, SPR_XFLIP_TOGGLE); SET(wu->Flags, SPR_XFLIP_TOGGLE);
if (pp->WpnRocketHeat) if (WpnRocketHeat)
{ {
switch (pp->WpnRocketType) switch (pp->WpnRocketType)
{ {
case 1: case 1:
pp->WpnRocketHeat--;
SET(wu->Flags, SPR_FIND_PLAYER); SET(wu->Flags, SPR_FIND_PLAYER);
break;
} }
} }