aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2016-03-09 23:37:47 +0100
committerWillem Jan Palenstijn2016-03-09 23:47:11 +0100
commitecc6a2cac11bf62d8ff0be2662606eacccbd68c9 (patch)
treefac24a8be70117bc4d9c281a6c61c2741f50f74d /engines
parentb0cd1d65875a509c489ff5eaf9cfbc1349e42006 (diff)
downloadscummvm-rg350-ecc6a2cac11bf62d8ff0be2662606eacccbd68c9.tar.gz
scummvm-rg350-ecc6a2cac11bf62d8ff0be2662606eacccbd68c9.tar.bz2
scummvm-rg350-ecc6a2cac11bf62d8ff0be2662606eacccbd68c9.zip
SCUMM: Make DOTT/MM patch check less strict
The original check broke if either DOTT or MM had a trailing path separator in the game path. The new check is too broad, but the risk of false positives should be minimal. The one in e11a370fe45aa96d240ff5f10e7263fdfc02bb01 would break if one of the two had a separator, but not both.
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/scumm.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 24d676a1ff..89d2d3dc72 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2611,8 +2611,12 @@ bool ScummEngine::startManiac() {
Common::String path = dom.getVal("path");
if (path.hasPrefix(currentPath)) {
- path.erase(0, currentPath.size() + 1);
- if (path.equalsIgnoreCase("maniac")) {
+ path.erase(0, currentPath.size());
+ // Do a case-insensitive non-path-mode match of the remainder.
+ // While strictly speaking it's too broad, this matchString
+ // ignores the presence or absence of trailing path separators
+ // in either currentPath or path.
+ if (path.matchString("*maniac*", true, false)) {
maniacTarget = iter->_key;
break;
}