From 2d29e5db29f0e38a83f1192d9f74832948c80447 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 9 Jan 2017 18:35:11 +0100 Subject: [PATCH] DIRECTOR: Add sanity check to 'go to' functions --- engines/director/lingo/lingo-funcs.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index 6becd1410d8..0deab0760cc 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -200,14 +200,23 @@ void Lingo::func_goto(Datum &frame, Datum &movie) { } void Lingo::func_gotoloop() { + if (!_vm->_currentScore) + return; + _vm->_currentScore->gotoloop(); } void Lingo::func_gotonext() { + if (!_vm->_currentScore) + return; + _vm->_currentScore->gotonext(); } void Lingo::func_gotoprevious() { + if (!_vm->_currentScore) + return; + _vm->_currentScore->gotoprevious(); }