mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
Fixed IsHUDModelForPlayerAvailable limitation.
This commit is contained in:
parent
888eab3063
commit
1d96b68e1a
1 changed files with 8 additions and 14 deletions
|
@ -777,20 +777,14 @@ FSpriteModelFrame * FindModelFrame(const PClass * ti, int sprite, int frame, boo
|
|||
|
||||
bool IsHUDModelForPlayerAvailable (player_t * player)
|
||||
{
|
||||
if (player == nullptr || player->ReadyWeapon == nullptr)
|
||||
return false;
|
||||
|
||||
// [MK] allow the Strife burning hands to be a model...
|
||||
DPSprite *psp = player->FindPSprite(PSP_STRIFEHANDS);
|
||||
|
||||
// [MK] ...otherwise, check for the weapon psprite as per usual
|
||||
if (psp == nullptr)
|
||||
psp = player->FindPSprite(PSP_WEAPON);
|
||||
|
||||
if (psp == nullptr)
|
||||
if (player == nullptr || player->psprites == nullptr)
|
||||
return false;
|
||||
|
||||
// [MK] check that at least one psprite uses models
|
||||
for (DPSprite *psp = player->psprites; psp != nullptr && psp->GetID() < PSP_TARGETCENTER; psp = psp->GetNext())
|
||||
{
|
||||
FSpriteModelFrame *smf = FindModelFrame(psp->Caller->GetClass(), psp->GetSprite(), psp->GetFrame(), false);
|
||||
return ( smf != nullptr );
|
||||
if ( smf != nullptr ) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue