[Scummvm-git-logs] scummvm master -> 4f099a8fff0930a81c085dc8aa6be1b46a3ba491

dreammaster dreammaster at scummvm.org
Wed Dec 27 07:46:03 CET 2017


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:
4f099a8fff XEEN: Fix saving of map stepped on tiles


Commit: 4f099a8fff0930a81c085dc8aa6be1b46a3ba491
    https://github.com/scummvm/scummvm/commit/4f099a8fff0930a81c085dc8aa6be1b46a3ba491
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-27T01:45:38-05:00

Commit Message:
XEEN: Fix saving of map stepped on tiles

Changed paths:
    engines/xeen/files.cpp
    engines/xeen/map.cpp


diff --git a/engines/xeen/files.cpp b/engines/xeen/files.cpp
index a889cfb..375b9df 100644
--- a/engines/xeen/files.cpp
+++ b/engines/xeen/files.cpp
@@ -321,22 +321,23 @@ void File::syncBitFlags(Common::Serializer &s, bool *startP, bool *endP) {
 	byte data = 0;
 
 	int bitCounter = 0;
-	for (bool *p = startP; p <= endP; ++p, bitCounter = (bitCounter + 1) % 8) {
-		if (p == endP || bitCounter == 0) {
-			if (p != endP || s.isSaving())
+	for (bool *p = startP; p < endP; ++p, bitCounter = (bitCounter + 1) % 8) {
+		if (bitCounter == 0) {
+			if (s.isLoading() || p != startP)
 				s.syncAsByte(data);
-			if (p == endP)
-				break;
 
 			if (s.isSaving())
 				data = 0;
 		}
 
 		if (s.isLoading())
-			*p = (data >> bitCounter) != 0;
+			*p = ((data >> bitCounter) & 1) != 0;
 		else if (*p)
 			data |= 1 << bitCounter;
 	}
+
+	if (s.isSaving())
+		s.syncAsByte(data);
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 27b746e..611101e 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -1452,7 +1452,7 @@ void Map::saveMap() {
 	if (!_isOutdoors) {
 		// Iterate through the surrounding mazes
 		for (int mazeIndex = 1; mazeIndex < 9; ++mazeIndex) {
-			mapId = _mazeData[_mazeDataIndex]._mazeId;
+			mapId = _mazeData[mazeIndex]._mazeId;
 			if (mapId == 0)
 				continue;
 





More information about the Scummvm-git-logs mailing list