- 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;
}
//===========================================================================
//
// 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

View File

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

View File

@ -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)