From 172bc97110b25d225401fd6777d8f48fee294600 Mon Sep 17 00:00:00 2001 From: sluicebox Date: Fri, 10 Jan 2020 16:44:21 -0800 Subject: SCI: Ignore incorrectly detected volume version Ignores a detected volume version of SCI3 when the map version is less than SCI2, as that indicates detectVolVersion's heuristics failed. SQ1VGA Russian has volume files with a few junk bytes in between resource entries, which causes detectVolVersion to return SCI3 instead of the expected result of Invalid and then use the correctly detected map version. The detection algorithm tries each version until it finds one that fits, and the SCI3 pattern happens to fit because it's necessarily the most permissive due to the wCompression bytes containing meaningless values. Fixes bug #10156 --- engines/sci/resource.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines') diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 779bd0acb2..a716a1230d 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -993,6 +993,11 @@ void ResourceManager::init() { _mapVersion = _volVersion; } + if ((_volVersion == kResVersionSci3) && (_mapVersion < kResVersionSci2)) { + warning("Detected volume version is too high for detected map version. Setting volume version to map version"); + _volVersion = _mapVersion; + } + debugC(1, kDebugLevelResMan, "resMan: Detected resource map version %d: %s", _mapVersion, versionDescription(_mapVersion)); debugC(1, kDebugLevelResMan, "resMan: Detected volume version %d: %s", _volVersion, versionDescription(_volVersion)); -- cgit v1.2.3