[Scummvm-cvs-logs] SF.net SVN: scummvm: [29241] scummvm/trunk/engines/parallaction/ parallaction.cpp

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Oct 21 17:41:22 CEST 2007


Revision: 29241
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29241&view=rev
Author:   peres001
Date:     2007-10-21 08:41:21 -0700 (Sun, 21 Oct 2007)

Log Message:
-----------
Relaxed freeZones policy for deciding which zones to preserve across location switches. Special zones are now never deleted even if strictly not needed. This will fix some occasional crashes related to inventory management.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/parallaction.cpp

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-10-21 15:26:07 UTC (rev 29240)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-10-21 15:41:21 UTC (rev 29241)
@@ -985,26 +985,15 @@
 
 	while ( it != _zones.end() ) {
 
+		// NOTE : this condition has been relaxed compared to the original, to allow the engine
+		// to retain special - needed - zones that were lost across location switches.
 		Zone* z = *it;
-
-		// WORKAROUND: this huge condition is needed because we made TypeData a collection of structs
-		// instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine,
-		// but we need to check it separately here. The same workaround is applied in hitZone.
-		if (((z->_top == -1) ||
-			((z->_left == -2) && (
-				(((z->_type & 0xFFFF) == kZoneMerge) && ((isItemInInventory(MAKE_INVENTORY_ID(z->u.merge->_obj1)) != 0) || (isItemInInventory(MAKE_INVENTORY_ID(z->u.merge->_obj2)) != 0))) ||
-				(((z->_type & 0xFFFF) == kZoneGet) && ((isItemInInventory(MAKE_INVENTORY_ID(z->u.get->_icon)) != 0)))
-			))) &&
-			((_engineFlags & kEngineQuit) == 0)) {
-
+		if (((z->_top == -1) || (z->_left == -2)) && ((_engineFlags & kEngineQuit) == 0)) {
 			debugC(2, kDebugExec, "freeZones preserving zone '%s'", z->_label._text);
-
 			it++;
-
-		} else
-
+		} else {
 			it = _zones.erase(it);
-
+		}
 	}
 
 	return;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list