From 75b9deb1856bae8355403faa5f55857f3929adb6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 11 May 2011 18:06:30 +0200 Subject: SCUMM: Get rid of the MemBlkHeader hack This uncovered at least one potentially serious bug in the inventory code, which still needs to be investigated and fixed. --- engines/scumm/object.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines/scumm/object.cpp') diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index 457e2c717c..8b0e22d33e 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -192,8 +192,11 @@ void ScummEngine::clearOwnerOf(int obj) { if (!_inventory[i] && _inventory[i+1]) { _inventory[i] = _inventory[i+1]; _inventory[i+1] = 0; - _res->_types[rtInventory].address[i] = _res->_types[rtInventory].address[i + 1]; - _res->_types[rtInventory].address[i + 1] = NULL; + // FIXME FIXME FIXME: This is incomplete, as we do not touch flags, status... BUG + _res->_types[rtInventory]._address[i] = _res->_types[rtInventory]._address[i + 1]; + _res->_types[rtInventory]._size[i] = _res->_types[rtInventory]._size[i + 1]; + _res->_types[rtInventory]._address[i + 1] = NULL; + _res->_types[rtInventory]._size[i + 1] = 0; } } break; @@ -1796,7 +1799,7 @@ int ScummEngine::findLocalObjectSlot() { int ScummEngine::findFlObjectSlot() { int i; for (i = 1; i < _numFlObject; i++) { - if (_res->_types[rtFlObject].address[i] == NULL) + if (_res->_types[rtFlObject]._address[i] == NULL) return i; } error("findFlObjectSlot: Out of FLObject slots"); -- cgit v1.2.3