Mercurial > mm7
diff UI/UIPopup.cpp @ 1944:02bc0fac639f
fixing inventory right click crash
author | Grumpy7 |
---|---|
date | Fri, 25 Oct 2013 00:51:32 -0700 |
parents | 2e6d3cd052e0 |
children | c1c74df0a33e |
line wrap: on
line diff
--- a/UI/UIPopup.cpp Thu Oct 24 23:22:46 2013 -0700 +++ b/UI/UIPopup.cpp Fri Oct 25 00:51:32 2013 -0700 @@ -1602,6 +1602,8 @@ pMouse->GetCursorPos(&cursor); int item_pid = (pRenderer->pActiveZBuffer[cursor.x + pSRZBufferLineOffsets[cursor.y]] & 0xFFFF) - 1; + if (item_pid == -1) //added here to avoid crash + return; auto item = &pPlayers[uActiveCharacter]->pInventoryItemList[item_pid]; if (cursor.x <= 13 || cursor.x >= 462)//items out of inventory(вещи вне инвентаря)