diff options
author | Paul Gilbert | 2018-04-16 07:37:49 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-04-16 07:37:49 -0400 |
commit | c92561cd614616924d5c82b6d8d5a0ac7fff215a (patch) | |
tree | fc6e2d56acf55a276ca40c50ec922a74918bf76d | |
parent | 77c06fe487b3735134f78db3e19be038410e1951 (diff) | |
download | scummvm-rg350-c92561cd614616924d5c82b6d8d5a0ac7fff215a.tar.gz scummvm-rg350-c92561cd614616924d5c82b6d8d5a0ac7fff215a.tar.bz2 scummvm-rg350-c92561cd614616924d5c82b6d8d5a0ac7fff215a.zip |
XEEN: Fix Swords scripts using cmdReturn instead of cmdExit
-rw-r--r-- | engines/xeen/scripts.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index dfd5c210d6..81ba0caab9 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -1048,11 +1048,16 @@ bool Scripts::cmdCallEvent(ParamsIterator ¶ms) { } bool Scripts::cmdReturn(ParamsIterator ¶ms) { - StackEntry se = _stack.pop(); - _currentPos = se; - _lineNum = se.line; + if (_stack.empty()) { + // WORKAROUND: Some scripts in Swords of Xeen use cmdReturn as a substitute for cmdExit + return cmdExit(params); + } else { + StackEntry se = _stack.pop(); + _currentPos = se; + _lineNum = se.line; - return true; + return true; + } } bool Scripts::cmdSetVar(ParamsIterator ¶ms) { |