From 2cf141e914a43d09b8a7eb195cef82614c78c4f2 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 7 Feb 2013 20:38:41 +0000 Subject: [PATCH] - In A_ReFire, allow refiring when a weapon is pending, but weapon switching is not okay at this time. SVN r4067 (trunk) --- src/p_pspr.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 192514058..1b4e0b55a 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -733,21 +733,21 @@ DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_ReFire) void A_ReFire(AActor *self, FState *state) { player_t *player = self->player; + bool pending; if (NULL == player) { return; } - if ((player->cmd.ucmd.buttons&BT_ATTACK) - && !player->ReadyWeapon->bAltFire - && player->PendingWeapon == WP_NOCHANGE && player->health) + pending = player->PendingWeapon == WP_NOCHANGE && (player->WeaponState & WF_WEAPONSWITCHOK); + if ((player->cmd.ucmd.buttons & BT_ATTACK) + && !player->ReadyWeapon->bAltFire && !pending && player->health > 0) { player->refire++; P_FireWeapon (player, state); } - else if ((player->cmd.ucmd.buttons&BT_ALTATTACK) - && player->ReadyWeapon->bAltFire - && player->PendingWeapon == WP_NOCHANGE && player->health) + else if ((player->cmd.ucmd.buttons & BT_ALTATTACK) + && player->ReadyWeapon->bAltFire && !pending && player->health > 0) { player->refire++; P_FireWeaponAlt (player, state); @@ -826,10 +826,6 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Lower) P_SetPsprite (player, ps_weapon, NULL); return; } -/* if (player->PendingWeapon != WP_NOCHANGE) - { // [RH] Make sure we're actually changing weapons. - player->ReadyWeapon = player->PendingWeapon; - } */ // [RH] Clear the flash state. Only needed for Strife. P_SetPsprite (player, ps_flash, NULL); P_BringUpWeapon (player);