[Scummvm-cvs-logs] scummvm master -> 0e99e02121d10fdc8d966cab6daced74b280cef9

dreammaster dreammaster at scummvm.org
Tue May 27 14:41:45 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:
0e99e02121 MADS: Fix saving game in the village hut


Commit: 0e99e02121d10fdc8d966cab6daced74b280cef9
    https://github.com/scummvm/scummvm/commit/0e99e02121d10fdc8d966cab6daced74b280cef9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-05-27T08:41:07-04:00

Commit Message:
MADS: Fix saving game in the village hut

Changed paths:
    engines/mads/action.cpp
    engines/mads/hotspots.cpp
    engines/mads/rails.cpp



diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp
index edb5f0f..80480cb 100644
--- a/engines/mads/action.cpp
+++ b/engines/mads/action.cpp
@@ -685,6 +685,10 @@ void MADSAction::synchronize(Common::Serializer &s) {
 	s.syncAsSint16LE(_statusTextIndex);
 	s.syncAsSint16LE(_hotspotId);
 	_savedFields.synchronize(s);
+
+	// TODO: When saving in Rex Village Hut, _senetence size() doesn't match
+	// string length. Find out why not
+	_sentence = Common::String(_sentence.c_str());
 	s.syncString(_sentence);
 
 	s.syncAsSint16LE(_verbType);
diff --git a/engines/mads/hotspots.cpp b/engines/mads/hotspots.cpp
index d3ce0a9..98080f7 100644
--- a/engines/mads/hotspots.cpp
+++ b/engines/mads/hotspots.cpp
@@ -154,6 +154,7 @@ void DynamicHotspots::synchronize(Common::Serializer &s) {
 		for (int i = 0; i < count; ++i)
 			_entries[i].synchronize(s);
 	} else {
+		_entries.clear();
 		DynamicHotspot rec;
 		rec.synchronize(s);
 		_entries.push_back(rec);
diff --git a/engines/mads/rails.cpp b/engines/mads/rails.cpp
index 6beee5a..7ae0d92 100644
--- a/engines/mads/rails.cpp
+++ b/engines/mads/rails.cpp
@@ -267,17 +267,8 @@ void Rails::synchronize(Common::Serializer &s) {
 	s.syncAsSint16LE(_routeLength);
 	s.syncAsSint16LE(_next);
 
-	int count = _routeIndexes.size();
-	if (s.isSaving()) {
-		for (int i = 0; i < count; ++i)
-			s.syncAsUint16LE(_routeIndexes[i]);
-	} else {
+	if (s.isLoading()) {
 		_routeIndexes.clear();
-		for (int i = 0; i < count; ++i) {
-			int v = 0;
-			s.syncAsUint16LE(v);
-			_routeIndexes.push(v);
-		}
 	}
 }
 






More information about the Scummvm-git-logs mailing list