- In A_ReFire, allow refiring when a weapon is pending, but weapon switching is not okay at this time.

SVN r4067 (trunk)
This commit is contained in:
Randy Heit 2013-02-07 20:38:41 +00:00
parent 522a940ccf
commit 2cf141e914

View file

@ -733,21 +733,21 @@ DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_ReFire)
void A_ReFire(AActor *self, FState *state) void A_ReFire(AActor *self, FState *state)
{ {
player_t *player = self->player; player_t *player = self->player;
bool pending;
if (NULL == player) if (NULL == player)
{ {
return; return;
} }
if ((player->cmd.ucmd.buttons&BT_ATTACK) pending = player->PendingWeapon == WP_NOCHANGE && (player->WeaponState & WF_WEAPONSWITCHOK);
&& !player->ReadyWeapon->bAltFire if ((player->cmd.ucmd.buttons & BT_ATTACK)
&& player->PendingWeapon == WP_NOCHANGE && player->health) && !player->ReadyWeapon->bAltFire && !pending && player->health > 0)
{ {
player->refire++; player->refire++;
P_FireWeapon (player, state); P_FireWeapon (player, state);
} }
else if ((player->cmd.ucmd.buttons&BT_ALTATTACK) else if ((player->cmd.ucmd.buttons & BT_ALTATTACK)
&& player->ReadyWeapon->bAltFire && player->ReadyWeapon->bAltFire && !pending && player->health > 0)
&& player->PendingWeapon == WP_NOCHANGE && player->health)
{ {
player->refire++; player->refire++;
P_FireWeaponAlt (player, state); P_FireWeaponAlt (player, state);
@ -826,10 +826,6 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Lower)
P_SetPsprite (player, ps_weapon, NULL); P_SetPsprite (player, ps_weapon, NULL);
return; 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. // [RH] Clear the flash state. Only needed for Strife.
P_SetPsprite (player, ps_flash, NULL); P_SetPsprite (player, ps_flash, NULL);
P_BringUpWeapon (player); P_BringUpWeapon (player);