aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorEugene Sandulenko2017-02-11 20:13:35 +0100
committerEugene Sandulenko2017-02-11 23:23:56 +0100
commit8b043bc7316b27c1d44d9e68111335346134cbeb (patch)
tree8372f5f3b3cf7d77d2bdeccdc22e3b13cc51bdd5 /engines/director
parente2b27d86d8b06e2d03f34f8db25311530165962b (diff)
downloadscummvm-rg350-8b043bc7316b27c1d44d9e68111335346134cbeb.tar.gz
scummvm-rg350-8b043bc7316b27c1d44d9e68111335346134cbeb.tar.bz2
scummvm-rg350-8b043bc7316b27c1d44d9e68111335346134cbeb.zip
DIRECTOR: Lingo: Simplfy movie presense check in 'go to movie'
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/lingo/lingo-funcs.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index 4bd85905c9..95a7506f8d 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -180,19 +180,23 @@ void Lingo::func_goto(Datum &frame, Datum &movie) {
if (movie.type != VOID) {
movie.toString();
- Common::File file;
-
- if (!file.open(*movie.u.s)) {
- if (_vm->getPlatform() == Common::kPlatformMacintosh) {
- Common::MacResManager resMan;
- if (!resMan.open(*movie.u.s)) {
- warning("Movie %s does not exist", movie.u.s->c_str());
- return;
- }
- } else {
- warning("Movie %s does not exist", movie.u.s->c_str());
- return;
+ bool fileExists = false;
+
+ if (_vm->getPlatform() == Common::kPlatformMacintosh) {
+ Common::MacResManager resMan;
+ if (resMan.open(*movie.u.s)) {
+ fileExists = true;
}
+ } else {
+ Common::File file;
+ if (file.open(*movie.u.s)) {
+ fileExists = true;
+ }
+ }
+
+ if (!fileExists) {
+ warning("Movie %s does not exist", movie.u.s->c_str());
+ return;
}
_vm->_nextMovie = *movie.u.s;