diff options
-rw-r--r-- | engines/mads/inventory.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/mads/inventory.cpp b/engines/mads/inventory.cpp index d41a55fe47..79a8e87b2a 100644 --- a/engines/mads/inventory.cpp +++ b/engines/mads/inventory.cpp @@ -161,6 +161,10 @@ void InventoryObjects::removeFromInventory(int objectId, int newScene) { invIndex = idx; } + // If the object isn't in the player's inventory, stop here + if (invIndex < 0) + return; + int selectedIndex = userInterface._selectedInvIndex; bool noSelection = selectedIndex < 0; |