From 9280c25a3617d5a60257f11c3f6864ef4fff99dd Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Sat, 6 Oct 2007 20:56:17 +0000 Subject: 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 --- engines/parallaction/inventory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines') 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; -- cgit v1.2.3