Skip to content

Commit

Permalink
ADL: Fix restarting from AllCommands list
Browse files Browse the repository at this point in the history
  • Loading branch information
waltervn committed Jun 6, 2016
1 parent 5fe95d5 commit bf520ca
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion engines/adl/adl.cpp
Expand Up @@ -573,6 +573,12 @@ Common::Error AdlEngine::run() {
}

doAllCommands(_globalCommands, verb, noun);

if (_isRestarting) {
_isRestarting = false;
continue;
}

advanceClock();
_state.moves++;
}
Expand Down Expand Up @@ -1197,8 +1203,12 @@ void AdlEngine::doAllCommands(const Commands &commands, byte verb, byte noun) {

for (cmd = commands.begin(); cmd != commands.end(); ++cmd) {
ScriptEnv env(*cmd, _state.room, verb, noun);
if (matchCommand(env))
if (matchCommand(env)) {
doActions(env);
// The original long jumps on restart, so we need to abort here
if (_isRestarting)
return;
}
}
}

Expand Down

0 comments on commit bf520ca

Please sign in to comment.