[Scummvm-git-logs] scummvm master -> c94e8ccac52d818ba4f033a9d82e612db6d69f42

elasota noreply at scummvm.org
Thu May 11 04:49:54 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c94e8ccac5 VCRUISE: Fix Schizm saves not reading inventory/sound count correctly.  Fix elevator sound playlist not working.


Commit: c94e8ccac52d818ba4f033a9d82e612db6d69f42
    https://github.com/scummvm/scummvm/commit/c94e8ccac52d818ba4f033a9d82e612db6d69f42
Author: elasota (ejlasota at gmail.com)
Date: 2023-05-11T00:49:38-04:00

Commit Message:
VCRUISE: Fix Schizm saves not reading inventory/sound count correctly.  Fix elevator sound playlist not working.

Changed paths:
    engines/vcruise/runtime.cpp


diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 5d3bd8c268d..dd31a79783c 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -484,7 +484,12 @@ void SfxData::load(Common::SeekableReadStream &stream, Audio::Mixer *mixer) {
 				}
 
 				if (!presets.empty()) {
-					for (Common::String &tokenRef : tokens) {
+					for (uint tokenIndex = 0; tokenIndex < tokens.size(); tokenIndex++) {
+						// Ignore presets for the sound name.  This fixes some breakage in e.g. Anim0134.sfx using elevator as both a sample and preset.
+						if (tokenIndex == 1)
+							continue;
+
+						Common::String &tokenRef = tokens[tokenIndex];
 						Common::HashMap<Common::String, Common::String>::const_iterator presetIt = presets.find(tokenRef);
 						if (presetIt != presets.end())
 							tokenRef = presetIt->_value;
@@ -878,12 +883,11 @@ LoadGameOutcome SaveGameSnapshot::read(Common::ReadStream *stream) {
 	listenerAngle = stream->readSint32BE();
 
 	uint numInventory[kMaxStates] = {};
-	for (uint sti = 0; sti < numStates; sti++)
-		numInventory[sti] = stream->readUint32BE();
-
 	uint numSounds[kMaxStates] = {};
-	for (uint sti = 0; sti < numStates; sti++)
+	for (uint sti = 0; sti < numStates; sti++) {
+		numInventory[sti] = stream->readUint32BE();
 		numSounds[sti] = stream->readUint32BE();
+	}
 
 	uint numOneShots = stream->readUint32BE();
 




More information about the Scummvm-git-logs mailing list