aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorsluicebox2020-01-10 16:44:21 -0800
committersluicebox2020-01-10 16:44:37 -0800
commit172bc97110b25d225401fd6777d8f48fee294600 (patch)
treee05ee7f5d13d11663fd85a08e35091ab7cfdc749 /engines
parent53901e7a9d84275cc47d6a7d8d4d0a8b56a651a7 (diff)
downloadscummvm-rg350-172bc97110b25d225401fd6777d8f48fee294600.tar.gz
scummvm-rg350-172bc97110b25d225401fd6777d8f48fee294600.tar.bz2
scummvm-rg350-172bc97110b25d225401fd6777d8f48fee294600.zip
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
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/resource.cpp5
1 files changed, 5 insertions, 0 deletions
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));