Skip to content

Commit

Permalink
XEEN: Fix Swords scripts using cmdReturn instead of cmdExit
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Apr 16, 2018
1 parent 77c06fe commit c92561c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions engines/xeen/scripts.cpp
Expand Up @@ -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) {
Expand Down

0 comments on commit c92561c

Please sign in to comment.