PINK: add proper implementation of Actor init function

This commit is contained in:
whiterandrek 2018-06-03 20:38:39 +03:00 committed by Eugene Sandulenko
parent 44efa90377
commit f7693d3971
4 changed files with 9 additions and 8 deletions

View File

@ -58,7 +58,7 @@ void Actor::saveState(Archive &archive) {
archive.writeString(actionName);
}
void Actor::init(bool unk) {
void Actor::init(bool paused) {
if (!_action)
_action = findAction(kIdleAction);
@ -66,7 +66,8 @@ void Actor::init(bool unk) {
_isActionEnded = 1;
} else {
_isActionEnded = 0;
_action->start(unk);
_action->start();
_action->pause(paused);
}
}
@ -168,7 +169,7 @@ void Actor::setAction(Action *newAction) {
_action = newAction;
if (newAction) {
_isActionEnded = 0;
_action->start(0);
_action->start();
}
}

View File

@ -47,7 +47,7 @@ public:
void loadState(Archive &archive);
void saveState(Archive &archive);
virtual void init(bool unk);
virtual void init(bool paused);
bool initPallete(Director *director);
void toConsole() override ;

View File

@ -65,7 +65,7 @@ void HandlerTimerActions::handle(Actor *actor) {
uint index = rnd.getRandomNumber(_actions.size() - 1);
Action *action = actor->findAction(_actions[index]);
assert(action);
actor->setAction(action, 0);
actor->setAction(action);
}
}

View File

@ -71,7 +71,7 @@ void WalkMgr::start(WalkLocation *destination) {
WalkShortestPath path(this);
WalkLocation *nextLocation = path.next(currentLocation, _destination);
initNextWayPoint(nextLocation);
_leadActor->setAction(getWalkAction(), 0);
_leadActor->setAction(getWalkAction());
}
}
@ -106,7 +106,7 @@ WalkMgr::Coordinates WalkMgr::getLocationCoordinates(const Common::String &locat
Coordinates coords;
ActionCEL *action = static_cast<ActionCEL*>(_leadActor->findAction(locationName));
action->start(0);
action->start();
CelDecoder *decoder = action->getDecoder();
coords.x = decoder->getX() + decoder->getWidth() / 2;
@ -132,7 +132,7 @@ void WalkMgr::update() {
WalkLocation *next = path.next(findLocation(_current.name), _destination);
if (next) {
initNextWayPoint(next);
_leadActor->setAction(getWalkAction(), 0);
_leadActor->setAction(getWalkAction());
} else
end();