ADL: Fix move counter

This commit is contained in:
Walter van Niftrik 2016-03-18 23:41:42 +01:00 committed by Walter van Niftrik
parent ee8c63183d
commit d09247baca
4 changed files with 7 additions and 7 deletions

View File

@ -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;
}

View File

@ -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<Command> 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);

View File

@ -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

View File

@ -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();