From d36aadd3a68883cd22b77d8c247dfc4ff17581b7 Mon Sep 17 00:00:00 2001 From: Evgeny Grechnikov Date: Sun, 14 Oct 2018 17:29:47 +0300 Subject: LASTEXPRESS: fix constants in sound serializer Wrong enum member used: (status & 0x7000000) should be checked against 0x3000000, not against 3 (this is a check of sound type to skip menu sounds in savefiles). Activate delay should not be compared with sound volume; comparison with 0x8000000 is just a sanity check against overflow. --- engines/lastexpress/sound/entry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp index 87ecd26cdb..a8c9b22cd4 100644 --- a/engines/lastexpress/sound/entry.cpp +++ b/engines/lastexpress/sound/entry.cpp @@ -366,7 +366,7 @@ void SoundEntry::saveLoadWithSerializer(Common::Serializer &s) { assert(_name1.size() <= 16); assert(_name2.size() <= 16); - if (_name2.matchString("NISSND?") && ((_status.status & kFlagType9) != kFlag3)) { + if (_name2.matchString("NISSND?") && ((_status.status & kFlagType9) != kFlagType13)) { s.syncAsUint32LE(_status.status); s.syncAsUint32LE(_type); s.syncAsUint32LE(_blockCount); // field_8; @@ -376,7 +376,7 @@ void SoundEntry::saveLoadWithSerializer(Common::Serializer &s) { s.syncAsUint32LE(_entity); uint32 delta = (uint32)_field_48 - getSound()->getData2(); - if (delta > kFlag8) + if (delta > 0x8000000u) // sanity check against overflow delta = 0; s.syncAsUint32LE(delta); -- cgit v1.2.3