diff options
-rw-r--r-- | scumm/imuse.cpp | 14 | ||||
-rw-r--r-- | scumm/instrument.cpp | 7 |
2 files changed, 13 insertions, 8 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index ceca85fbeb..951c9bea55 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -3094,13 +3094,17 @@ int IMuseInternal::save_or_load(Serializer *ser, Scumm *scumm) ser->saveLoadArrayOf(_players, ARRAYSIZE(_players), sizeof(_players[0]), playerEntries); ser->saveLoadArrayOf(_parts, ARRAYSIZE(_parts), sizeof(_parts[0]), partEntries); - // Load/save the instrument definitions, which were revamped with V11. - if (ser->getVersion() >= VER_V11) { + { // Load/save the instrument definitions, which were revamped with V11. int i; Part *part = &_parts[0]; - for (i = ARRAYSIZE(_parts); i; --i, ++part) { - part->_program = 255; - part->_instrument.saveOrLoad (ser); + if (ser->getVersion() >= VER_V11) { + for (i = ARRAYSIZE(_parts); i; --i, ++part) { + part->_program = 255; + part->_instrument.saveOrLoad (ser); + } + } else { + for (i = ARRAYSIZE(_parts); i; --i, ++part) + part->_instrument.clear(); } } diff --git a/scumm/instrument.cpp b/scumm/instrument.cpp index c2ebaffb1f..897c6d4086 100644 --- a/scumm/instrument.cpp +++ b/scumm/instrument.cpp @@ -286,8 +286,8 @@ void Instrument::saveOrLoad (Serializer *s) _instrument->saveOrLoad (s); } else { clear(); - byte type = s->loadByte(); - switch (type) { + _type = s->loadByte(); + switch (_type) { case itNone: break; case itProgram: @@ -300,7 +300,8 @@ void Instrument::saveOrLoad (Serializer *s) _instrument = new Instrument_Roland (s); break; default: - warning ("No known instrument classification #%d", (int) type); + warning ("No known instrument classification #%d", (int) _type); + _type = itNone; } } } |