Fix: crash when displaying LBE with corrupted content.

This des not fix whatever corrupts the LBE, it merely stops the game from crashing.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8373 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-01-22 20:37:13 +00:00
parent 4690b89ffc
commit 43fa9090c1
+8
View File
@@ -8149,9 +8149,17 @@ void RenderLBENODEItems( OBJECTTYPE *pObj, int subObject )
}
else if(activeNode == true)
{
// Flugente: if LBE inv des not exist (corrupted memory?), don't try to access it. This doesn't solve the issue of HOW it got corrupted, but at least we don't crash the game anymore...
if ( pLBE->inv.size() <= cnt )
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Error in RenderLBENODEItems(...): contents of %s likely corrupted!", Item[pObj->usItem].szItemName );
continue;
}
if(pLBE->inv[cnt].exists() == true)
pObject = &pLBE->inv[cnt];
}
if(lbePocket == 0){ // Deactivate Pocket
DrawHatchOnInventory( guiSAVEBUFFER, sX, sY, (UINT16)(LBEInvPocketXY[cnt].sWidth-1), (UINT16)(LBEInvPocketXY[cnt].sHeight-1), 0 );
}