diff options
author | Bastien Bouclet | 2017-11-25 08:19:57 +0100 |
---|---|---|
committer | Bastien Bouclet | 2017-11-26 08:51:36 +0100 |
commit | 0bd2e53cd49f21f3db4b6c8b762033ce1320172f (patch) | |
tree | ca493f7b72f4af3855c11c99448a4fd7b924cb13 /engines/fullpipe | |
parent | 32de1d678e65b62607da55ec72fe1d4e75ab0f88 (diff) | |
download | scummvm-rg350-0bd2e53cd49f21f3db4b6c8b762033ce1320172f.tar.gz scummvm-rg350-0bd2e53cd49f21f3db4b6c8b762033ce1320172f.tar.bz2 scummvm-rg350-0bd2e53cd49f21f3db4b6c8b762033ce1320172f.zip |
FULLPIPE: Fix handleInteraction for non static ani objects
cce851d1af introduced a check to allow only static ani objects. However
after this change, only part of the pipes for vertical movement were
interactive.
This change aims to restore functionality for the other object types
while still preventing the invalid casts.
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/interaction.cpp | 73 | ||||
-rw-r--r-- | engines/fullpipe/statics.cpp | 3 |
2 files changed, 38 insertions, 38 deletions
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp index 08c8c8fe47..38ca73b539 100644 --- a/engines/fullpipe/interaction.cpp +++ b/engines/fullpipe/interaction.cpp @@ -168,50 +168,51 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject return false; if (!inter->_objectId2) { - if (obj->_objtype != kObjTypeStaticANIObject) - return false; - - StaticANIObject *ani = static_cast<StaticANIObject *>(obj); - - if (!ani->isIdle()) - return false; + if (obj->_objtype == kObjTypeStaticANIObject) { + StaticANIObject *ani = static_cast<StaticANIObject *>(obj); - if (ani->_flags & 0x100) - return false; + if (inter->_flags & 1) { + if (!ani->isIdle()) + return false; - if (!inter->_staticsId1 || !(inter->_flags & 1)) - goto LABEL_38; + if (ani->_flags & 0x100) + return false; + } else if (inter->_staticsId1 != 0) { + if (ani->_movement || ani->_statics == 0 || ani->_statics->_staticsId != inter->_staticsId1) { + mq = ani->changeStatics1(inter->_staticsId1); + if (!mq) + return false; - if (ani->_movement || ani->_statics == 0 || ani->_statics->_staticsId != inter->_staticsId1) { - mq = ani->changeStatics1(inter->_staticsId1); - if (!mq) - return false; + ex = new ExCommand((subj ? subj->_id : 0), 55, 0, 0, 0, 0, 1, 0, 0, 0); + ex->_x = obj->_id; + ex->_y = obj->_odelay; + ex->_param = subj ? subj->_odelay : 0; + ex->_excFlags = 3; + ex->_field_14 = (obj->_objtype != kObjTypePictureObject); + ex->_field_20 = invId; + mq->addExCommandToEnd(ex); - ex = new ExCommand((subj ? subj->_id : 0), 55, 0, 0, 0, 0, 1, 0, 0, 0); - ex->_x = obj->_id; - ex->_y = obj->_odelay; - ex->_param = subj ? subj->_odelay : 0; - ex->_excFlags = 3; - ex->_field_14 = (obj->_objtype != kObjTypePictureObject); - ex->_field_20 = invId; - mq->addExCommandToEnd(ex); + if (mq->_isFinished) { + mq->_isFinished = 0; + ani->queueMessageQueue(mq); + } - if (mq->_isFinished) { - mq->_isFinished = 0; - ani->queueMessageQueue(mq); + return true; + } else { + if (ani->getMessageQueue()) + ani->queueMessageQueue(0); + } } - } else { - if (ani->getMessageQueue()) - ani->queueMessageQueue(0); -LABEL_38: - if (inter->_messageQueue) { - mq = new MessageQueue(inter->_messageQueue, 0, 1); - mq->changeParam28ForObjectId(ani->_id, -1, ani->_odelay); + } - if (!mq->chain(0)) - return false; - } + if (inter->_messageQueue) { + mq = new MessageQueue(inter->_messageQueue, 0, 1); + mq->changeParam28ForObjectId(obj->_id, -1, obj->_odelay); + + if (!mq->chain(0)) + return false; } + return true; } diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index 524eeff5d9..a1252a75af 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -348,8 +348,7 @@ void StaticANIObject::startMQIfIdle(int qId, int flag) { } bool StaticANIObject::isIdle() { - if (_objtype != kObjTypeStaticANIObject) - return true; + assert(_objtype == kObjTypeStaticANIObject); if (_messageQueueId) { MessageQueue *m = g_fp->_globalMessageQueueList->getMessageQueueById(_messageQueueId); |