[Scummvm-git-logs] scummvm master -> 1091e82ed30e97347e30f5b8e9ca8f6011c98396

AndywinXp noreply at scummvm.org
Sun Oct 8 10:04:27 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1091e82ed3 SCUMM: Do not fill inventory gaps before v4


Commit: 1091e82ed30e97347e30f5b8e9ca8f6011c98396
    https://github.com/scummvm/scummvm/commit/1091e82ed30e97347e30f5b8e9ca8f6011c98396
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-10-08T12:04:19+02:00

Commit Message:
SCUMM: Do not fill inventory gaps before v4

Verified from INDY3 and ZAK disasms

Changed paths:
    engines/scumm/object.cpp


diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index aa9875c39e9..fae612728ea 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -184,7 +184,6 @@ void ScummEngine::clearOwnerOf(int obj) {
 			}
 		}
 	} else {
-
 		// Alternatively, scan the inventory to see if the object is in there...
 		for (i = 0; i < _numInventory; i++) {
 			if (_inventory[i] == obj) {
@@ -194,18 +193,22 @@ void ScummEngine::clearOwnerOf(int obj) {
 				_res->nukeResource(rtInventory, i);
 				_inventory[i] = 0;
 
-				// Now fill up the gap removing the object from the inventory created.
-				for (i = 0; i < _numInventory - 1; i++) {
-					if (!_inventory[i] && _inventory[i+1]) {
-						_inventory[i] = _inventory[i+1];
-						_inventory[i+1] = 0;
-						// FIXME FIXME FIXME: This is incomplete, as we do not touch flags, status... BUG
-						_res->_types[rtInventory][i]._address = _res->_types[rtInventory][i + 1]._address;
-						_res->_types[rtInventory][i]._size = _res->_types[rtInventory][i + 1]._size;
-						_res->_types[rtInventory][i + 1]._address = nullptr;
-						_res->_types[rtInventory][i + 1]._size = 0;
+				// Verified from INDY3 disasm, the gaps were not being filled up before v4...
+				if (_game.version < 4) {
+					// Now fill up the gap removing the object from the inventory created.
+					for (i = 0; i < _numInventory - 1; i++) {
+						if (!_inventory[i] && _inventory[i + 1]) {
+							_inventory[i] = _inventory[i + 1];
+							_inventory[i + 1] = 0;
+							// FIXME FIXME FIXME: This is incomplete, as we do not touch flags, status... BUG
+							_res->_types[rtInventory][i]._address = _res->_types[rtInventory][i + 1]._address;
+							_res->_types[rtInventory][i]._size = _res->_types[rtInventory][i + 1]._size;
+							_res->_types[rtInventory][i + 1]._address = nullptr;
+							_res->_types[rtInventory][i + 1]._size = 0;
+						}
 					}
 				}
+
 				break;
 			}
 		}




More information about the Scummvm-git-logs mailing list