diff options
author | Paul Gilbert | 2014-05-27 08:41:07 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-05-27 08:41:07 -0400 |
commit | 0e99e02121d10fdc8d966cab6daced74b280cef9 (patch) | |
tree | 44ccfe2debf0af3112038a242a0a53db5c1f12bf | |
parent | 787cbe18e806425311b8013d75dfd9de562b9da7 (diff) | |
download | scummvm-rg350-0e99e02121d10fdc8d966cab6daced74b280cef9.tar.gz scummvm-rg350-0e99e02121d10fdc8d966cab6daced74b280cef9.tar.bz2 scummvm-rg350-0e99e02121d10fdc8d966cab6daced74b280cef9.zip |
MADS: Fix saving game in the village hut
-rw-r--r-- | engines/mads/action.cpp | 4 | ||||
-rw-r--r-- | engines/mads/hotspots.cpp | 1 | ||||
-rw-r--r-- | engines/mads/rails.cpp | 11 |
3 files changed, 6 insertions, 10 deletions
diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp index edb5f0f8f2..80480cbdfd 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 d3ce0a9263..98080f729a 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 6beee5a242..7ae0d92265 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); - } } } |