aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/behavior.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/fullpipe/behavior.cpp')
-rw-r--r--engines/fullpipe/behavior.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp
index abea906d9b..75cb027d7a 100644
--- a/engines/fullpipe/behavior.cpp
+++ b/engines/fullpipe/behavior.cpp
@@ -180,7 +180,15 @@ void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, B
}
bool BehaviorManager::setBehaviorEnabled(StaticANIObject *obj, int aniId, int quId, int flag) {
- warning("STUB: BehaviorManager::setBehaviorEnabled()");
+ BehaviorEntryInfo *entry = getBehaviorEntryInfoByMessageQueueDataId(obj, aniId, quId);
+
+ if (entry) {
+ if (flag)
+ entry->_flags &= 0xFFFFFFFE;
+ else
+ entry->_flags |= 1;
+ } else
+ return false;
return true;
}
@@ -199,7 +207,18 @@ void BehaviorManager::setFlagByStaticAniObject(StaticANIObject *ani, int flag) {
}
BehaviorEntryInfo *BehaviorManager::getBehaviorEntryInfoByMessageQueueDataId(StaticANIObject *ani, int id1, int id2) {
- warning("STUB: getBehaviorEntryInfoByMessageQueueDataId()");
+ for (uint i = 0; i < _behaviors.size(); i++) {
+ if (_behaviors[i]->_ani == ani) {
+ for (uint j = 0; j < _behaviors[i]->_bheItems.size(); j++) {
+ if (_behaviors[i]->_bheItems[j]->_staticsId == id1) {
+ for (int k = 0; k < _behaviors[i]->_bheItems[j]->_itemsCount; k++) {
+ if (_behaviors[i]->_bheItems[j]->_items[k]->_messageQueue->_dataId == id2)
+ return _behaviors[i]->_bheItems[j]->_items[k];
+ }
+ }
+ }
+ }
+ }
return 0;
}