Skip to content

Commit

Permalink
SCUMM: Make DOTT/MM patch check less strict
Browse files Browse the repository at this point in the history
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 e11a370 would break if one
of the two had a separator, but not both.
  • Loading branch information
wjp committed Mar 9, 2016
1 parent 2f65273 commit 9ddd3ab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions engines/scumm/scumm.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9ddd3ab

Please sign in to comment.