diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 60d577daee8..0925f193b2c 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -94,9 +94,7 @@ void Actor::initActor(int mode) { memset(sound, 0, sizeof(sound)); targetFacing = facing; - if (walkScript) - _vm->stopScript(walkScript); - moving = 0; + stopActorMoving(); shadow_mode = 0; layer = 0; @@ -138,10 +136,9 @@ void Actor::initActor(int mode) { } void Actor::stopActorMoving() { - if (walkScript) + if (_vm->_version >= 7) _vm->stopScript(walkScript); moving = 0; - startAnimActor(standFrame); } void Actor::setActorWalkSpeed(uint newSpeedX, uint newSpeedY) { @@ -593,8 +590,8 @@ void Actor::putActor(int dstX, int dstY, byte newRoom) { if (visible) { if (isInCurrentRoom()) { if (moving) { + stopActorMoving(); startAnimActor(standFrame); - moving = 0; } adjustActorPos(); } else { @@ -708,12 +705,9 @@ void Actor::adjustActorPos() { walkdata.dest.x = -1; - moving = 0; + stopActorMoving(); cost.soundCounter = 0; - if (walkScript) - _vm->stopScript(walkScript); - if (walkbox != kInvalidBox) { byte flags = _vm->getBoxFlags(walkbox); if (flags & 7) { @@ -755,8 +749,8 @@ void Actor::hideActor() { return; if (moving) { + stopActorMoving(); startAnimActor(standFrame); - moving = 0; } visible = false; cost.soundCounter = 0; @@ -785,7 +779,7 @@ void Actor::showActor() { if (!moving && _vm->_version <= 2) startAnimActor(standFrame); - moving = 0; + stopActorMoving(); visible = true; needRedraw = true; } diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 3c4ccbde121..02613b8e474 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -1892,6 +1892,7 @@ void ScummEngine_v6::o6_actorOps() { break; case 229: // SO_ACTOR_STOP a->stopActorMoving(); + a->startAnimActor(a->standFrame); break; case 230: /* set direction */ a->moving &= ~MF_TURN; diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index dd8e744f3d3..0d09074430a 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1039,6 +1039,7 @@ void ScummEngine_v8::o8_actorOps() { break; case 0x80: // SO_ACTOR_STOP a->stopActorMoving(); + a->startAnimActor(a->standFrame); break; case 0x81: // SO_ACTOR_FACE Make actor face angle a->moving &= ~MF_TURN; diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 6003e92f9dd..a1bd2728ec8 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -2222,7 +2222,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) { getObjectXYPos(objectNr, x, y, dir); a->putActor(x, y, _currentRoom); a->setDirection(dir + 180); - a->moving = 0; + a->stopActorMoving(); } showActors();