XEEN: Fix Swords scripts using cmdReturn instead of cmdExit

This commit is contained in:
Paul Gilbert 2018-04-16 07:37:49 -04:00
parent 77c06fe487
commit c92561cd61

View File

@ -1048,11 +1048,16 @@ bool Scripts::cmdCallEvent(ParamsIterator &params) {
}
bool Scripts::cmdReturn(ParamsIterator &params) {
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 &params) {