aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDenis Kasak2009-08-09 16:58:04 +0000
committerDenis Kasak2009-08-09 16:58:04 +0000
commitb9a9a5ef8801f83886a6249f4ad24122cfe0569d (patch)
treef56af7770802ca5f9eb2e4a6cdae19844e77622b /engines
parentabedc7e9bb44a13ebf62e0cb37d8e317afc27e28 (diff)
downloadscummvm-rg350-b9a9a5ef8801f83886a6249f4ad24122cfe0569d.tar.gz
scummvm-rg350-b9a9a5ef8801f83886a6249f4ad24122cfe0569d.tar.bz2
scummvm-rg350-b9a9a5ef8801f83886a6249f4ad24122cfe0569d.zip
Implemented GPL function Script::funcObjStat().
svn-id: r43176
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/script.cpp18
-rw-r--r--engines/draci/script.h1
2 files changed, 18 insertions, 1 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index 872b10a3cb..af64204f42 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -125,7 +125,7 @@ void Script::setupCommandList() {
{ "IsObjOn", &Script::funcIsObjOn },
{ "IsObjOff", &Script::funcIsObjOff },
{ "IsObjAway", &Script::funcIsObjAway },
- { "ObjStat", NULL },
+ { "ObjStat", &Script::funcObjStat },
{ "LastBlock", NULL },
{ "AtBegin", NULL },
{ "BlockVar", NULL },
@@ -269,6 +269,22 @@ int Script::funcIsObjOff(int objID) {
return !obj->_visible && obj->_location != -1;
}
+int Script::funcObjStat(int objID) {
+ objID -= 1;
+
+ GameObject *obj = _vm->_game->getObject(objID);
+
+ if (obj->_location == _vm->_game->getRoomNum()) {
+ if (obj->_visible) {
+ return 1; // object is ON (in the room and visible)
+ } else {
+ return 2; // object is OFF (in the room, not visible)
+ }
+ } else {
+ return 3; // object is AWAY (not in the room)
+ }
+}
+
int Script::funcIsObjAway(int objID) {
objID -= 1;
diff --git a/engines/draci/script.h b/engines/draci/script.h
index f6df7ecee5..6c85a7cc5b 100644
--- a/engines/draci/script.h
+++ b/engines/draci/script.h
@@ -147,6 +147,7 @@ private:
int funcIsObjOff(int objID);
int funcIsObjAway(int objID);
int funcActPhase(int objID);
+ int funcObjStat(int objID);
void setupCommandList();