mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 07:12:36 +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)
|
bool IsHUDModelForPlayerAvailable (player_t * player)
|
||||||
{
|
{
|
||||||
if (player == nullptr || player->ReadyWeapon == nullptr)
|
if (player == nullptr || player->psprites == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// [MK] allow the Strife burning hands to be a model...
|
// [MK] check that at least one psprite uses models
|
||||||
DPSprite *psp = player->FindPSprite(PSP_STRIFEHANDS);
|
for (DPSprite *psp = player->psprites; psp != nullptr && psp->GetID() < PSP_TARGETCENTER; psp = psp->GetNext())
|
||||||
|
{
|
||||||
// [MK] ...otherwise, check for the weapon psprite as per usual
|
FSpriteModelFrame *smf = FindModelFrame(psp->Caller->GetClass(), psp->GetSprite(), psp->GetFrame(), false);
|
||||||
if (psp == nullptr)
|
if ( smf != nullptr ) return true;
|
||||||
psp = player->FindPSprite(PSP_WEAPON);
|
}
|
||||||
|
return false;
|
||||||
if (psp == nullptr)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
FSpriteModelFrame *smf = FindModelFrame(psp->Caller->GetClass(), psp->GetSprite(), psp->GetFrame(), false);
|
|
||||||
return ( smf != nullptr );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue