Skip to content

Commit

Permalink
PINK: move the same code to function setReadyAfterWalk
Browse files Browse the repository at this point in the history
  • Loading branch information
voltya authored and sev- committed Jun 28, 2018
1 parent 84af69c commit 2c4336c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 9 additions & 8 deletions engines/pink/objects/actors/lead_actor.cpp
Expand Up @@ -155,10 +155,8 @@ void LeadActor::update() {

void LeadActor::loadPDA(const Common::String &pageName) {
if (_state != kPDA) {
if (_state == kMoving) {
_recipient = nullptr;
_nextState = kReady;
}
if (_state == kMoving)
setReadyAfterWalk();
if (_state != kInventory)
_page->pause(true);

Expand Down Expand Up @@ -268,10 +266,8 @@ void LeadActor::onClick() {
_nextState = (_state != kMoving) ?
kUnk_Loading : kReady;
} else {
if (_state == kMoving) {
_recipient = nullptr;
_nextState = kReady;
}
if (_state == kMoving)
setReadyAfterWalk();
startInventory(0);
}
}
Expand Down Expand Up @@ -391,6 +387,11 @@ void LeadActor::startInventory(bool fromSave) {
_page->pause(true);
}

void LeadActor::setReadyAfterWalk() {
_recipient = nullptr;
_nextState = kReady;
}

void ParlSqPink::toConsole() {
debug("ParlSqPink: _name = %s", _name.c_str());
for (uint i = 0; i < _actions.size(); ++i) {
Expand Down
2 changes: 2 additions & 0 deletions engines/pink/objects/actors/lead_actor.h
Expand Up @@ -102,6 +102,8 @@ class LeadActor : public Actor {

void startInventory(bool fromSave);

void setReadyAfterWalk();

Actor *_recipient;

CursorMgr *_cursorMgr;
Expand Down

0 comments on commit 2c4336c

Please sign in to comment.