parent
d933f77bf5
commit
8668719bbc
15 changed files with 48 additions and 55 deletions
|
|
@ -311,12 +311,6 @@ void DPSprite::SetState(FState *newstate, bool pending)
|
|||
return;
|
||||
}
|
||||
|
||||
void P_SetPsprite(player_t *player, PSPLayers id, FState *state, bool pending)
|
||||
{
|
||||
if (player == nullptr) return;
|
||||
player->GetPSprite(id)->SetState(state, pending);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// PROC P_BringUpWeapon
|
||||
|
|
@ -373,7 +367,7 @@ void P_BringUpWeapon (player_t *player)
|
|||
? WEAPONTOP : WEAPONBOTTOM;
|
||||
// make sure that the previous weapon's flash state is terminated.
|
||||
// When coming here from a weapon drop it may still be active.
|
||||
P_SetPsprite(player, PSP_FLASH, nullptr);
|
||||
player->GetPSprite(PSP_FLASH)->SetState(nullptr);
|
||||
psweapon->SetState(newstate);
|
||||
player->mo->weaponspecial = 0;
|
||||
}
|
||||
|
|
@ -407,7 +401,7 @@ void P_FireWeapon (player_t *player, FState *state)
|
|||
{
|
||||
state = weapon->GetAtkState(!!player->refire);
|
||||
}
|
||||
P_SetPsprite(player, PSP_WEAPON, state);
|
||||
player->GetPSprite(PSP_WEAPON)->SetState(state);
|
||||
if (!(weapon->WeaponFlags & WIF_NOALERT))
|
||||
{
|
||||
P_NoiseAlert (player->mo, player->mo, false);
|
||||
|
|
@ -445,7 +439,7 @@ void P_FireWeaponAlt (player_t *player, FState *state)
|
|||
state = weapon->GetAltAtkState(!!player->refire);
|
||||
}
|
||||
|
||||
P_SetPsprite(player, PSP_WEAPON, state);
|
||||
player->GetPSprite(PSP_WEAPON)->SetState(state);
|
||||
if (!(weapon->WeaponFlags & WIF_NOALERT))
|
||||
{
|
||||
P_NoiseAlert (player->mo, player->mo, false);
|
||||
|
|
@ -470,7 +464,7 @@ void P_DropWeapon (player_t *player)
|
|||
player->WeaponState &= ~WF_DISABLESWITCH;
|
||||
if (player->ReadyWeapon != nullptr)
|
||||
{
|
||||
P_SetPsprite(player, PSP_WEAPON, player->ReadyWeapon->GetDownState());
|
||||
player->GetPSprite(PSP_WEAPON)->SetState(player->ReadyWeapon->GetDownState());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -814,7 +808,7 @@ static void P_CheckWeaponButtons (player_t *player)
|
|||
// state, the weapon won't disappear. ;)
|
||||
if (state != nullptr)
|
||||
{
|
||||
P_SetPsprite(player, PSP_WEAPON, state);
|
||||
player->GetPSprite(PSP_WEAPON)->SetState(state);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -1045,7 +1039,7 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Lower)
|
|||
return 0;
|
||||
}
|
||||
// [RH] Clear the flash state. Only needed for Strife.
|
||||
P_SetPsprite(player, PSP_FLASH, nullptr);
|
||||
player->GetPSprite(PSP_FLASH)->SetState(nullptr);
|
||||
P_BringUpWeapon (player);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1152,7 +1146,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_GunFlash)
|
|||
flash = player->ReadyWeapon->FindState(NAME_Flash);
|
||||
}
|
||||
}
|
||||
P_SetPsprite(player, PSP_FLASH, flash);
|
||||
player->GetPSprite(PSP_FLASH)->SetState(flash);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue