diff options
author | Walter van Niftrik | 2016-04-10 15:27:28 +0200 |
---|---|---|
committer | Walter van Niftrik | 2016-06-06 20:35:49 +0200 |
commit | bf520ca3211a1638396efe71e19291e7dbd979c0 (patch) | |
tree | 8c8999d8fc8965c0221cbf939f0145bafa2f4226 /engines/adl | |
parent | 5fe95d51ea3d35e9de725a08b3681fbc3f8844bc (diff) | |
download | scummvm-rg350-bf520ca3211a1638396efe71e19291e7dbd979c0.tar.gz scummvm-rg350-bf520ca3211a1638396efe71e19291e7dbd979c0.tar.bz2 scummvm-rg350-bf520ca3211a1638396efe71e19291e7dbd979c0.zip |
ADL: Fix restarting from AllCommands list
Diffstat (limited to 'engines/adl')
-rw-r--r-- | engines/adl/adl.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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; + } } } |