From bf520ca3211a1638396efe71e19291e7dbd979c0 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Sun, 10 Apr 2016 15:27:28 +0200 Subject: ADL: Fix restarting from AllCommands list --- engines/adl/adl.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'engines/adl/adl.cpp') diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index 328638ade1..b77f8da52b 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -573,6 +573,12 @@ Common::Error AdlEngine::run() { } doAllCommands(_globalCommands, verb, noun); + + if (_isRestarting) { + _isRestarting = false; + continue; + } + advanceClock(); _state.moves++; } @@ -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; + } } } -- cgit v1.2.3