From 53b41cf32f1c42bca254a3d30ebbf32841fc4b8f 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 ef9cdb4e8..c5178fd7d 100644 --- a/src/g_inventory/a_weapons.cpp +++ b/src/g_inventory/a_weapons.cpp @@ -234,26 +234,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 ea2460b08..581629af6 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 de4686605..7d031d32d 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -677,7 +677,8 @@ bool player_t::Resurrect() } if (ReadyWeapon != nullptr) { - P_SetPsprite(this, PSP_WEAPON, ReadyWeapon->GetUpState()); + PendingWeapon = ReadyWeapon; + P_BringUpWeapon(this); } if (morphTics)