From 8e1e4b9079a96d5b48bc445fabd01c4067ba9635 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Mon, 24 Sep 2007 19:45:18 +0000 Subject: Fixed inventory regression introduced with yesterday's commit. svn-id: r29091 --- engines/parallaction/inventory.cpp | 5 +---- engines/parallaction/saveload.cpp | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index b41a6f9f8d..56a29ea277 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -333,10 +333,7 @@ void Inventory::clear(bool keepVerbs) { ItemName Inventory::getItemName(ItemPosition pos) const { - // TODO: should assert against the number of items actually contained, - // not the theoretical limit. - assert(pos >= 0 && pos < INVENTORY_MAX_ITEMS); - return _items[pos]._index; + return (pos >= 0 && pos < INVENTORY_MAX_ITEMS) ? _items[pos]._index : 0; } const InventoryItem* Inventory::getItem(ItemPosition pos) const { diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 778466a9cd..84c376cd8f 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -147,7 +147,6 @@ void Parallaction_ns::doLoadGame(uint16 slot) { f->readLine(s, 15); name = atoi(s); - printf("loadGame: inv[%i].id = %i, inv[%i].index = %i\n", _si, value, _si, name); addInventoryItem(name, value); } -- cgit v1.2.3