Added assertion with error message to prevent silent crashes/nullptr dereference if loading big item graphics fails.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9396 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Asdow
2022-08-16 13:37:08 +00:00
parent b843d82f54
commit 317f741811
+1
View File
@@ -1930,6 +1930,7 @@ BOOLEAN DisplayBigItemImage(UINT16 usIndex, UINT16 PosY)
LoadTileGraphicForItem(pItem, &uiImage);
GetVideoObject(&hPixHandle, uiImage);
if (hPixHandle == nullptr) { SET_ERROR("Error: Could not load item uiIndex %d graphics. ubGraphicType %d and ubGraphicNum %d", usIndex, pItem->ubGraphicType, pItem->ubGraphicNum); AssertMsg(false, gubErrorText); }
if(hPixHandle->ubBitDepth == 8)
{