mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-06 18:00:44 +00:00
MADS: Workaround for incorrect saving of dynamic hotspots in older savegames
This commit is contained in:
parent
0e99e02121
commit
46150086ab
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user