aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2016-03-19 00:13:21 +0100
committerWalter van Niftrik2016-06-06 20:35:49 +0200
commit8a05a9cbca3c86868e148e09c392c2bd53bc4de0 (patch)
treed7f67818e464fd0e797821b6606ca1fe58f7e82a
parentd8035140e2a0d4210cd77e4b24fe3430aacc6ea2 (diff)
downloadscummvm-rg350-8a05a9cbca3c86868e148e09c392c2bd53bc4de0.tar.gz
scummvm-rg350-8a05a9cbca3c86868e148e09c392c2bd53bc4de0.tar.bz2
scummvm-rg350-8a05a9cbca3c86868e148e09c392c2bd53bc4de0.zip
ADL: Implement final hires2 conditional opcode
-rw-r--r--engines/adl/adl_v2.cpp11
-rw-r--r--engines/adl/adl_v2.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp
index 4ef2ae27df..8af3fc9ffb 100644
--- a/engines/adl/adl_v2.cpp
+++ b/engines/adl/adl_v2.cpp
@@ -53,7 +53,7 @@ void AdlEngine_v2::setupOpcodeTables() {
Opcode(o2_isNounNotInRoom);
Opcode(o1_isMovesGT);
Opcode(o1_isVarEQ);
- OpcodeUnImpl();
+ Opcode(o2_isCarryingSomething);
// 0x08
OpcodeUnImpl();
Opcode(o1_isCurPicEQ);
@@ -147,6 +147,15 @@ int AdlEngine_v2::o2_isNounNotInRoom(ScriptEnv &e) {
return 1;
}
+int AdlEngine_v2::o2_isCarryingSomething(ScriptEnv &e) {
+ Common::Array<Item>::const_iterator item;
+
+ for (item = _state.items.begin(); item != _state.items.end(); ++item)
+ if (item->room == IDI_NONE)
+ return 0;
+ return -1;
+}
+
int AdlEngine_v2::o2_moveItem(ScriptEnv &e) {
byte room = e.arg(2);
diff --git a/engines/adl/adl_v2.h b/engines/adl/adl_v2.h
index 5513da38a8..585bd9610c 100644
--- a/engines/adl/adl_v2.h
+++ b/engines/adl/adl_v2.h
@@ -47,6 +47,7 @@ protected:
int o2_isRandomGT(ScriptEnv &e);
int o2_isItemInRoom(ScriptEnv &e);
int o2_isNounNotInRoom(ScriptEnv &e);
+ int o2_isCarryingSomething(ScriptEnv &e);
int o2_moveItem(ScriptEnv &e);