aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNicola Mettifogo2007-10-06 20:56:17 +0000
committerNicola Mettifogo2007-10-06 20:56:17 +0000
commit9280c25a3617d5a60257f11c3f6864ef4fff99dd (patch)
treee9cc57102959382116e22aae1d50b2bc306c166a /engines
parentabed92e2fac41d3e866d56ba84e213646871187f (diff)
downloadscummvm-rg350-9280c25a3617d5a60257f11c3f6864ef4fff99dd.tar.gz
scummvm-rg350-9280c25a3617d5a60257f11c3f6864ef4fff99dd.tar.bz2
scummvm-rg350-9280c25a3617d5a60257f11c3f6864ef4fff99dd.zip
Fixed bug #1808620. The original Inventory::addItem routine relied on a trick that went undetected until r29060 actually broke it. Not all regression is bad, after all.
svn-id: r29157
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/inventory.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp
index 2f6b5ac7a1..5a1baa6ace 100644
--- a/engines/parallaction/inventory.cpp
+++ b/engines/parallaction/inventory.cpp
@@ -265,8 +265,12 @@ ItemPosition Inventory::addItem(ItemName name, uint32 value) {
if (_numItems == INVENTORY_MAX_ITEMS)
return -1;
+ // NOTE: items whose name == 0 aren't really inventory items,
+ // but the engine expects the inventory to accept them as valid.
+ // This nasty trick has been discovered because of regression
+ // after r29060.
if (name == 0)
- return -1;
+ return 0;
_items[_numItems]._id = value;
_items[_numItems]._index = name;