mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
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:
@@ -1930,6 +1930,7 @@ BOOLEAN DisplayBigItemImage(UINT16 usIndex, UINT16 PosY)
|
|||||||
LoadTileGraphicForItem(pItem, &uiImage);
|
LoadTileGraphicForItem(pItem, &uiImage);
|
||||||
|
|
||||||
GetVideoObject(&hPixHandle, 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)
|
if(hPixHandle->ubBitDepth == 8)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user