NANCY: Clear generic flags when loading save

This fixes some weird behavior in scenes that use the
kSound dependency type. When the player clicks a trigger
that plays a sound, but saves the game while the sound
is being played, that trigger may end up disabled on load,
breaking the game.
This commit is contained in:
Kaloyan Chehlarski 2023-11-28 11:37:32 +02:00
parent 2bd6092738
commit a97ee89118

View File

@ -662,6 +662,11 @@ void Scene::synchronize(Common::Serializer &ser) {
ser.syncArray(_flags.eventFlags.data(), g_nancy->getStaticData().numEventFlags, Common::Serializer::Byte);
// Clear generic flags
for (uint16 id : g_nancy->getStaticData().genericEventFlags) {
_flags.eventFlags[id] = g_nancy->_false;
}
// Skip empty sceneCount array
ser.skip(2001 * 2, 0, 2);