From efe76a6647977fd53c279689b29ce8244a64df79 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Apr 2021 16:32:42 +0200 Subject: [PATCH] - Blood: fixed crash with badly defined drop objects. Got -1 for picnum there, this was causing crashes. --- source/games/blood/src/actor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 1ffdd1d79..364373526 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2854,7 +2854,12 @@ spritetype *actDropObject(spritetype *pSprite, int nType) { else if (nType >= kItemAmmoBase && nType < kItemAmmoMax) pSprite2 = actDropAmmo(pSprite, nType); else if (nType >= kItemWeaponBase && nType < kItemWeaponMax) pSprite2 = actDropWeapon(pSprite, nType); - if (pSprite2 && pSprite->picnum > -1) { + if (pSprite2) { + if (pSprite2->picnum == -1) + { + DeleteSprite(pSprite2 - sprite); + return nullptr; + } int top, bottom; GetSpriteExtents(pSprite2, &top, &bottom); if (bottom >= pSprite2->z)