- let player_t::Resurrect use P_BringUpWeapon to raise the weapon again instead of doing it directly.

This seems a bit safer.
This commit is contained in:
Christoph Oelckers 2018-11-24 17:24:08 +01:00
parent 9584e3bc53
commit d8aa39e03e
3 changed files with 2 additions and 22 deletions

View file

@ -227,26 +227,6 @@ bool AWeapon::CheckAmmo(int fireMode, bool autoSwitch, bool requireAmmo, int amm
return false; 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 // AWeapon :: GetDownState

View file

@ -129,7 +129,6 @@ public:
void Serialize(FSerializer &arc) override; void Serialize(FSerializer &arc) override;
// scripted virtuals. // scripted virtuals.
FState *GetUpState ();
FState *GetDownState (); FState *GetDownState ();
enum enum

View file

@ -690,7 +690,8 @@ bool player_t::Resurrect()
} }
if (ReadyWeapon != nullptr) if (ReadyWeapon != nullptr)
{ {
P_SetPsprite(this, PSP_WEAPON, ReadyWeapon->GetUpState()); PendingWeapon = ReadyWeapon;
P_BringUpWeapon(this);
} }
if (morphTics) if (morphTics)