diff options
| -rw-r--r-- | engines/draci/script.cpp | 18 | ||||
| -rw-r--r-- | engines/draci/script.h | 1 | 
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(); | 
