removed the quite redundant GetStateForButtonName function

Since it forwards directly to FindState and has no script bindings there is no need to keep it, it'd only complicate the full scriptification of the weapon class if it stuck around.
This commit is contained in:
Christoph Oelckers 2018-11-19 18:26:23 +01:00
parent ad04001135
commit e90ed0a01c
3 changed files with 1 additions and 14 deletions

View file

@ -467,17 +467,6 @@ FState *AWeapon::GetReadyState ()
return nullptr;
}
//===========================================================================
//
// AWeapon :: GetStateForButtonName
//
//===========================================================================
FState *AWeapon::GetStateForButtonName (FName button)
{
return FindState(button);
}
/* Weapon slots ***********************************************************/

View file

@ -132,8 +132,6 @@ public:
FState *GetUpState ();
FState *GetDownState ();
FState *GetReadyState ();
FState *GetStateForButtonName (FName button);
enum
{

View file

@ -892,7 +892,7 @@ static void P_CheckWeaponButtons (player_t *player)
if ((player->WeaponState & ButtonChecks[i].StateFlag) &&
(player->cmd.ucmd.buttons & ButtonChecks[i].ButtonFlag))
{
FState *state = weapon->GetStateForButtonName(ButtonChecks[i].StateName);
FState *state = weapon->FindState(ButtonChecks[i].StateName);
// [XA] don't change state if still null, so if the modder
// sets WRF_xxx to true but forgets to define the corresponding
// state, the weapon won't disappear. ;)