aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/director/lingo/lingo-funcs.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index ddc51f4149..f8a17f3bdb 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -180,17 +180,29 @@ void Lingo::func_goto(Datum &frame, Datum &movie) {
if (movie.type != VOID) {
movie.toString();
+ Common::String cleanedFilename;
+
+ for (const char *p = movie.u.s->c_str(); *p; p++)
+ if (*p >= 0x20 && *p <= 0x7f)
+ cleanedFilename += *p;
+
bool fileExists = false;
if (_vm->getPlatform() == Common::kPlatformMacintosh) {
Common::MacResManager resMan;
if (resMan.open(*movie.u.s)) {
fileExists = true;
+ cleanedFilename = *movie.u.s;
+ } else if (resMan.open(cleanedFilename)) {
+ fileExists = true;
}
} else {
Common::File file;
if (file.open(*movie.u.s)) {
fileExists = true;
+ cleanedFilename = *movie.u.s;
+ } else if (file.open(cleanedFilename)) {
+ fileExists = true;
}
}
@@ -199,7 +211,7 @@ void Lingo::func_goto(Datum &frame, Datum &movie) {
return;
}
- _vm->_nextMovie = *movie.u.s;
+ _vm->_nextMovie = cleanedFilename;
_vm->getCurrentScore()->_stopPlay = true;
_vm->_nextMovieFrameS.clear();