From d8aa39e03e49530eeb660999ad3b2569ece24af7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Nov 2018 17:24:08 +0100 Subject: [PATCH] - let player_t::Resurrect use P_BringUpWeapon to raise the weapon again instead of doing it directly. This seems a bit safer. --- src/g_inventory/a_weapons.cpp | 20 -------------------- src/g_inventory/a_weapons.h | 1 - src/p_user.cpp | 3 ++- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/g_inventory/a_weapons.cpp b/src/g_inventory/a_weapons.cpp index 0cd0583bec..251a58bcb4 100644 --- a/src/g_inventory/a_weapons.cpp +++ b/src/g_inventory/a_weapons.cpp @@ -227,26 +227,6 @@ bool AWeapon::CheckAmmo(int fireMode, bool autoSwitch, bool requireAmmo, int amm return false; } -//=========================================================================== -// -// AWeapon :: GetUpState -// -//=========================================================================== - -FState *AWeapon::GetUpState () -{ - IFVIRTUAL(AWeapon, GetUpState) - { - VMValue params[1] = { (DObject*)this }; - VMReturn ret; - FState *retval; - ret.PointerAt((void**)&retval); - VMCall(func, params, 1, &ret, 1); - return retval; - } - return nullptr; -} - //=========================================================================== // // AWeapon :: GetDownState diff --git a/src/g_inventory/a_weapons.h b/src/g_inventory/a_weapons.h index ea2460b081..581629af64 100644 --- a/src/g_inventory/a_weapons.h +++ b/src/g_inventory/a_weapons.h @@ -129,7 +129,6 @@ public: void Serialize(FSerializer &arc) override; // scripted virtuals. - FState *GetUpState (); FState *GetDownState (); enum diff --git a/src/p_user.cpp b/src/p_user.cpp index 3b3802cc2a..245a9fd211 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -690,7 +690,8 @@ bool player_t::Resurrect() } if (ReadyWeapon != nullptr) { - P_SetPsprite(this, PSP_WEAPON, ReadyWeapon->GetUpState()); + PendingWeapon = ReadyWeapon; + P_BringUpWeapon(this); } if (morphTics)