aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2016-03-09 23:37:10 +0100
committerWillem Jan Palenstijn2016-03-09 23:37:10 +0100
commitb0cd1d65875a509c489ff5eaf9cfbc1349e42006 (patch)
tree10846e0f571f1008e1fe3166fed7bc18f37debc0 /engines/scumm
parent14c8bdafe5ce73df57662221316345ed443a6323 (diff)
downloadscummvm-rg350-b0cd1d65875a509c489ff5eaf9cfbc1349e42006.tar.gz
scummvm-rg350-b0cd1d65875a509c489ff5eaf9cfbc1349e42006.tar.bz2
scummvm-rg350-b0cd1d65875a509c489ff5eaf9cfbc1349e42006.zip
Revert "SCUMM: Fix detection of Maniac Mansion from within DoTT"
This reverts commit e11a370fe45aa96d240ff5f10e7263fdfc02bb01.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/scumm.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 8d6214cf9f..24d676a1ff 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2608,31 +2608,13 @@ bool ScummEngine::startManiac() {
Common::ConfigManager::DomainMap::iterator iter = ConfMan.beginGameDomains();
for (; iter != ConfMan.endGameDomains(); ++iter) {
Common::ConfigManager::Domain &dom = iter->_value;
- Common::String path1 = dom.getVal("path");
+ Common::String path = dom.getVal("path");
- if (path1.hasPrefix(currentPath)) {
- // In some ports (e.g. Windows), the "path" will end with a
- // path separator. In others (e.g. Linux), it won't. And
- // we have no way of knowing exactly what the separator
- // is. The technical term for this is "annoying".
-
- path1.erase(0, currentPath.size());
-
- if (!path1.empty()) {
- // If we've found the path we're looking for, all that
- // remains now is the "maniac" part of it. If paths end
- // with a separator, we'll have "maniac" followed by a
- // separator. If they don't, we'll have a separator
- // followed by "maniac".
- Common::String path2 = path1;
-
- path1.erase(0, 1);
- path2.deleteLastChar();
-
- if (path1.equalsIgnoreCase("maniac") || path2.equalsIgnoreCase("maniac")) {
- maniacTarget = iter->_key;
- break;
- }
+ if (path.hasPrefix(currentPath)) {
+ path.erase(0, currentPath.size() + 1);
+ if (path.equalsIgnoreCase("maniac")) {
+ maniacTarget = iter->_key;
+ break;
}
}
}