diff options
-rw-r--r-- | engines/director/lingo/lingo-funcs.cpp | 14 | ||||
-rw-r--r-- | engines/director/score.h | 1 |
2 files changed, 12 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index 39e50f5565..eca6641a31 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -46,7 +46,7 @@ #include "engines/director/lingo/lingo.h" #include "common/file.h" #include "audio/decoders/wave.h" - +#include "common/util.h" #include "director/lingo/lingo-gr.h" namespace Director { @@ -196,8 +196,16 @@ void Lingo::func_goto(Common::String &frame, Common::String &movie) { _vm->_currentScore = _vm->_movies->getVal(movie); _vm->_currentScore->loadArchive(); - if (!frame.empty()) - _vm->_currentScore->setStartToLabel(frame); + if (frame.empty()) + return; + + for (uint16 i = 0; i < frame.size(); i++) { + if (!Common::isDigit(frame[i])) { + _vm->_currentScore->setStartToLabel(frame); + return; + } + } + _vm->_currentScore->setCurrentFrame(strtol(frame.c_str(), 0, 10)); } } diff --git a/engines/director/score.h b/engines/director/score.h index 592201ed97..06536d97b6 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -342,6 +342,7 @@ public: void processEvents(); Archive *getArchive() const { return _movieArchive; }; void loadCastData(Common::SeekableSubReadStreamEndian &stream); + void setCurrentFrame(uint16 frameId) { _currentFrame = frameId; } Common::String getMacName() const { return _macName; } private: void update(); |