From d8367d63cbbe4f8244db2809e0951d35dd06c85b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 1 Feb 2014 13:20:30 +0200 Subject: [PATCH] FULLPIPE: Implement lift_closedoorSeq() --- engines/fullpipe/constants.h | 1 + engines/fullpipe/lift.cpp | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 47416f9560c4..91882173c5d6 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -256,6 +256,7 @@ namespace Fullpipe { #define ST_LBN_8P 2775 #define ST_LBN_9P 2778 #define ST_LFT_CLOSED 1049 +#define ST_LFT_OPEN_NEW 1071 #define ST_MAN_EMPTY 476 #define ST_MAN_GOU 459 #define ST_MAN_RIGHT 325 diff --git a/engines/fullpipe/lift.cpp b/engines/fullpipe/lift.cpp index cb8be5ffa19d..068e9c3fd728 100644 --- a/engines/fullpipe/lift.cpp +++ b/engines/fullpipe/lift.cpp @@ -278,7 +278,40 @@ void FullpipeEngine::lift_exitSeq(ExCommand *cmd) { } void FullpipeEngine::lift_closedoorSeq() { - warning("STUB: FullpipeEngine::lift_closedoorSeq()"); + if (_lift->_movement) { + if (_lift->_movement->_id == MV_LFT_CLOSE) { + _lift->queueMessageQueue(0); + } else if (_lift->_movement->_id == MV_LFT_OPEN) { + int ph = _lift->_movement->_currDynamicPhaseIndex; + + _lift->changeStatics2(ST_LFT_OPEN_NEW); + _lift->startAnim(MV_LFT_CLOSE, 0, -1); + + if (_lift->_movement->_currMovement) + _lift->_movement->setDynamicPhaseIndex(_lift->_movement->_currMovement->_dynamicPhases.size() - ph); + else + _lift->_movement->setDynamicPhaseIndex(_lift->_movement->_dynamicPhases.size() - ph); + } else { + _lift->changeStatics2(ST_LFT_OPEN_NEW); + + _lift->startAnim(MV_LFT_CLOSE, 0, -1); + } + } else { + if (_lift->_statics->_staticsId == ST_LFT_CLOSED ) { + _lift->changeStatics2(ST_LFT_CLOSED); + } else { + _lift->startAnim(MV_LFT_CLOSE, 0, -1); + } + } + + MessageQueue *mq = new MessageQueue(_globalMessageQueueList->compact()); + ExCommand *ex = new ExCommand(0, 17, MSG_LIFT_GO, 0, 0, 0, 1, 0, 0, 0); + + ex->_excFlags |= 3; + mq->addExCommandToEnd(ex); + + if (!mq->chain(_lift)) + delete mq; } void FullpipeEngine::lift_walkAndGo() {