[Scummvm-cvs-logs] scummvm master -> 46150086abded1e074d98757ea584f14641b1a36

dreammaster dreammaster at scummvm.org
Tue May 27 14:57:27 CEST 2014


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:
46150086ab MADS: Workaround for incorrect saving of dynamic hotspots in older savegames


Commit: 46150086abded1e074d98757ea584f14641b1a36
    https://github.com/scummvm/scummvm/commit/46150086abded1e074d98757ea584f14641b1a36
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-05-27T08:56:51-04:00

Commit Message:
MADS: Workaround for incorrect saving of dynamic hotspots in older savegames

Changed paths:
    engines/mads/hotspots.cpp



diff --git a/engines/mads/hotspots.cpp b/engines/mads/hotspots.cpp
index 98080f7..497791c 100644
--- a/engines/mads/hotspots.cpp
+++ b/engines/mads/hotspots.cpp
@@ -150,14 +150,10 @@ void DynamicHotspots::synchronize(Common::Serializer &s) {
 	int count = _entries.size();
 	s.syncAsSint16LE(count);
 
-	if (s.isSaving()) {
-		for (int i = 0; i < count; ++i)
-			_entries[i].synchronize(s);
-	} else {
-		_entries.clear();
-		DynamicHotspot rec;
-		rec.synchronize(s);
-		_entries.push_back(rec);
+	// The MIN in the below loop is a workaround to fix earlier savegame
+	// loading accidentally adding new dynamic hotspots to the fixed list
+	for (int i = 0; i < count; ++i) {
+		_entries[MIN(i, (int)_entries.size() - 1)].synchronize(s);
 	}
 }
 






More information about the Scummvm-git-logs mailing list