mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
- treat PSP layer ID 0 as invalid
No PSprites with this ID may ever be created, as there is no means to find them again.
This commit is contained in:
parent
f3d557bcf5
commit
bc566fac4e
2 changed files with 2 additions and 1 deletions
|
@ -316,7 +316,7 @@ DPSprite *player_t::GetPSprite(PSPLayers layer)
|
|||
newcaller = ReadyWeapon;
|
||||
}
|
||||
|
||||
if (newcaller == nullptr) return nullptr; // Error case was not handled properly. This function cannot give a guarantee to always succeed!
|
||||
if (newcaller == nullptr || layer == PSP_CALLERID) return nullptr; // Error case was not handled properly. This function cannot give a guarantee to always succeed!
|
||||
|
||||
DPSprite *pspr = FindPSprite(layer);
|
||||
if (pspr == nullptr)
|
||||
|
|
|
@ -51,6 +51,7 @@ class player_t;
|
|||
enum PSPLayers
|
||||
{
|
||||
PSP_STRIFEHANDS = -1,
|
||||
PSP_CALLERID = 0,
|
||||
PSP_WEAPON = 1,
|
||||
PSP_FLASH = 1000,
|
||||
PSP_TARGETCENTER = INT_MAX - 2,
|
||||
|
|
Loading…
Reference in a new issue