mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user