From d09247bacaea68af05703218373479cdb0f558bd Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Fri, 18 Mar 2016 23:41:42 +0100 Subject: ADL: Fix move counter --- engines/adl/adl.cpp | 6 +++--- engines/adl/adl.h | 4 ++-- engines/adl/adl_v2.cpp | 2 +- engines/adl/hires1.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index 778d8212be..036e8f1049 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -294,7 +294,7 @@ void AdlEngine::setupOpcodeTables() { Opcode(o1_isItemInRoom); // 0x04 OpcodeUnImpl(); - Opcode(o1_isMovesGrEq); + Opcode(o1_isMovesGT); Opcode(o1_isVarEq); OpcodeUnImpl(); // 0x08 @@ -859,8 +859,8 @@ int AdlEngine::o1_isItemInRoom(ScriptEnv &e) { return 2; } -int AdlEngine::o1_isMovesGrEq(ScriptEnv &e) { - if (e.arg(1) > _state.moves) +int AdlEngine::o1_isMovesGT(ScriptEnv &e) { + if (e.arg(1) >= _state.moves) return -1; return 1; } diff --git a/engines/adl/adl.h b/engines/adl/adl.h index 9e29d1f08a..b6e8dfac59 100644 --- a/engines/adl/adl.h +++ b/engines/adl/adl.h @@ -145,7 +145,7 @@ struct State { uint16 moves; bool isDark; - State() : room(1), moves(0), isDark(false) { } + State() : room(1), moves(1), isDark(false) { } }; typedef Common::List Commands; @@ -178,7 +178,7 @@ protected: // Opcodes int o1_isItemInRoom(ScriptEnv &e); - int o1_isMovesGrEq(ScriptEnv &e); + int o1_isMovesGT(ScriptEnv &e); int o1_isVarEq(ScriptEnv &e); int o1_isCurPicEq(ScriptEnv &e); int o1_isItemPicEq(ScriptEnv &e); diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp index 3a938b3ae5..1e5553a22a 100644 --- a/engines/adl/adl_v2.cpp +++ b/engines/adl/adl_v2.cpp @@ -51,7 +51,7 @@ void AdlEngine_v2::setupOpcodeTables() { Opcode(o2_isItemInRoom); // 0x04 Opcode(o2_isNounNotInRoom); - Opcode(o1_isMovesGrEq); + Opcode(o1_isMovesGT); Opcode(o1_isVarEq); OpcodeUnImpl(); // 0x08 diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp index 9527d4e8aa..f7f16c0cd3 100644 --- a/engines/adl/hires1.cpp +++ b/engines/adl/hires1.cpp @@ -210,7 +210,7 @@ void HiRes1Engine::initState() { Common::File f; _state.room = 1; - _state.moves = 0; + _state.moves = 1; _state.isDark = false; _state.vars.clear(); -- cgit v1.2.3