From e90ed0a01cd64152ccf0ad03e7a95d6132fbd6bc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 19 Nov 2018 18:26:23 +0100 Subject: [PATCH] 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. --- src/g_inventory/a_weapons.cpp | 11 ----------- src/g_inventory/a_weapons.h | 2 -- src/p_pspr.cpp | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/g_inventory/a_weapons.cpp b/src/g_inventory/a_weapons.cpp index c026eda04a..a72a10d7e8 100644 --- a/src/g_inventory/a_weapons.cpp +++ b/src/g_inventory/a_weapons.cpp @@ -467,17 +467,6 @@ FState *AWeapon::GetReadyState () return nullptr; } -//=========================================================================== -// -// AWeapon :: GetStateForButtonName -// -//=========================================================================== - -FState *AWeapon::GetStateForButtonName (FName button) -{ - return FindState(button); -} - /* Weapon slots ***********************************************************/ diff --git a/src/g_inventory/a_weapons.h b/src/g_inventory/a_weapons.h index 4c6f6ab45f..1e0634ddd5 100644 --- a/src/g_inventory/a_weapons.h +++ b/src/g_inventory/a_weapons.h @@ -132,8 +132,6 @@ public: FState *GetUpState (); FState *GetDownState (); FState *GetReadyState (); - - FState *GetStateForButtonName (FName button); enum { diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 948cdf8a00..76587f6cbd 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -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. ;)