mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
Fixed: the game could crash if some inventory items were destroyed in a
certain way
This commit is contained in:
parent
360ad7a844
commit
d933f77bf5
1 changed files with 4 additions and 1 deletions
|
@ -1651,7 +1651,10 @@ void R_DrawPlayerSprites ()
|
||||||
while (psp)
|
while (psp)
|
||||||
{
|
{
|
||||||
// [RH] Don't draw the targeter's crosshair if the player already has a crosshair set.
|
// [RH] Don't draw the targeter's crosshair if the player already has a crosshair set.
|
||||||
if (psp->GetID() != PSP_TARGETCENTER || CrosshairImage == nullptr)
|
// It's possible this psprite's caller is now null but the layer itself hasn't been destroyed
|
||||||
|
// because it didn't tick yet (if we typed 'take all' while in the console for example).
|
||||||
|
// In this case let's simply not draw it to avoid crashing.
|
||||||
|
if ((psp->GetID() != PSP_TARGETCENTER || CrosshairImage == nullptr) && psp->GetCaller() != nullptr)
|
||||||
{
|
{
|
||||||
R_DrawPSprite(psp, camera, bobx, boby, wx, wy, r_TicFracF);
|
R_DrawPSprite(psp, camera, bobx, boby, wx, wy, r_TicFracF);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue