diff options
Diffstat (limited to 'engines/pink/objects')
-rw-r--r-- | engines/pink/objects/actors/lead_actor.cpp | 11 | ||||
-rw-r--r-- | engines/pink/objects/actors/lead_actor.h | 2 | ||||
-rw-r--r-- | engines/pink/objects/walk/walk_mgr.cpp | 8 | ||||
-rw-r--r-- | engines/pink/objects/walk/walk_mgr.h | 2 |
4 files changed, 18 insertions, 5 deletions
diff --git a/engines/pink/objects/actors/lead_actor.cpp b/engines/pink/objects/actors/lead_actor.cpp index 4d09281d29..0c59c2e842 100644 --- a/engines/pink/objects/actors/lead_actor.cpp +++ b/engines/pink/objects/actors/lead_actor.cpp @@ -177,10 +177,10 @@ void LeadActor::onKeyboardButtonClick(Common::KeyCode code) { case kMoving: switch (code) { case Common::KEYCODE_ESCAPE: - // set unk variables + setReadyAfterWalk(); // Fall Through intended case Common::KEYCODE_SPACE: - //skip walking animation + _walkMgr->skip(); default: break; } @@ -280,7 +280,7 @@ void LeadActor::onInventoryClosed(bool isItemClicked) { forceUpdateCursor(); } -void LeadActor::onWalkEnd() { +void LeadActor::onWalkEnd(const Common::String &stopName) { State oldNextState = _nextState; _state = kReady; _nextState = kUnk_Loading; @@ -290,6 +290,11 @@ void LeadActor::onWalkEnd() { else sendLeftClickMessage(_recipient); } + else { + Action *action = findAction(stopName); + assert(action); + setAction(action); + } } void LeadActor::onPDAClose() { diff --git a/engines/pink/objects/actors/lead_actor.h b/engines/pink/objects/actors/lead_actor.h index 9e1f8cb4ea..e632e7ba05 100644 --- a/engines/pink/objects/actors/lead_actor.h +++ b/engines/pink/objects/actors/lead_actor.h @@ -79,7 +79,7 @@ public: virtual void onClick(); virtual void onVariableSet() {} void onInventoryClosed(bool isItemClicked); - void onWalkEnd(); + void onWalkEnd(const Common::String &stopName); void onPDAClose(); bool isInteractingWith(Actor *actor); diff --git a/engines/pink/objects/walk/walk_mgr.cpp b/engines/pink/objects/walk/walk_mgr.cpp index 1336991aba..7e88ac95cf 100644 --- a/engines/pink/objects/walk/walk_mgr.cpp +++ b/engines/pink/objects/walk/walk_mgr.cpp @@ -135,7 +135,7 @@ void WalkMgr::update() { void WalkMgr::end() { _isWalking = false; - _leadActor->onWalkEnd(); + _leadActor->onWalkEnd(_destination->getName()); } void WalkMgr::loadState(Archive &archive) { @@ -160,4 +160,10 @@ void WalkMgr::saveState(Archive &archive) { } } +void WalkMgr::skip() { + initNextWayPoint(_destination); + _current = _next; + end(); +} + } // End of namespace Pink diff --git a/engines/pink/objects/walk/walk_mgr.h b/engines/pink/objects/walk/walk_mgr.h index a836bfc522..dd08e61236 100644 --- a/engines/pink/objects/walk/walk_mgr.h +++ b/engines/pink/objects/walk/walk_mgr.h @@ -56,6 +56,8 @@ public: void loadState(Archive &archive); void saveState(Archive &archive); + void skip(); + private: struct WayPoint { Common::String name; |