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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Mar 28 15:17:17 CET 2009


Revision: 39723
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39723&view=rev
Author:   peres001
Date:     2009-03-28 14:17:17 +0000 (Sat, 28 Mar 2009)

Log Message:
-----------
Added initialization for _index and _locationIndex in Zone objects.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/objects.cpp
    scummvm/trunk/engines/parallaction/objects.h
    scummvm/trunk/engines/parallaction/parallaction_br.cpp

Modified: scummvm/trunk/engines/parallaction/objects.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/objects.cpp	2009-03-28 14:03:51 UTC (rev 39722)
+++ scummvm/trunk/engines/parallaction/objects.cpp	2009-03-28 14:17:17 UTC (rev 39723)
@@ -184,7 +184,8 @@
 	_label = 0;
 
 	// BRA specific
-	_index = 0;
+	_index = INVALID_ZONE_INDEX;
+	_locationIndex = INVALID_LOCATION_INDEX;
 	_linkedName = 0;
 }
 

Modified: scummvm/trunk/engines/parallaction/objects.h
===================================================================
--- scummvm/trunk/engines/parallaction/objects.h	2009-03-28 14:03:51 UTC (rev 39722)
+++ scummvm/trunk/engines/parallaction/objects.h	2009-03-28 14:17:17 UTC (rev 39723)
@@ -266,6 +266,9 @@
 
 #define ZONENAME_LENGTH 32
 
+#define INVALID_LOCATION_INDEX ((uint32)-1)
+#define INVALID_ZONE_INDEX ((uint32)-1)
+
 struct Zone {
 private:
 	int16			_right;

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2009-03-28 14:03:51 UTC (rev 39722)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2009-03-28 14:17:17 UTC (rev 39723)
@@ -486,6 +486,10 @@
 }
 
 void Parallaction_br::restoreOrSaveZoneFlags(ZonePtr z, bool restore) {
+	if ((z->_locationIndex == INVALID_LOCATION_INDEX) || (z->_index == INVALID_ZONE_INDEX)) {
+		return;
+	}
+
 	if (restore) {
 		z->_flags = _zoneFlags[z->_locationIndex][z->_index];
 	} else {


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