diff --git a/engines/grim/actor.cpp b/engines/grim/actor.cpp index 44cbf6f29be..1f69907f676 100644 --- a/engines/grim/actor.cpp +++ b/engines/grim/actor.cpp @@ -1013,6 +1013,18 @@ void Actor::setMumbleChore(int chore, Costume *cost) { _mumbleChore = Chore(cost, chore); } +bool Actor::playLastWearChore() { + if (!_lastWearChore.isValid()) + return false; + + _lastWearChore.playLooping(false, 0); + return true; +} + +void Actor::setLastWearChore(int chore, Costume *cost) { + _lastWearChore = Chore(cost, chore); +} + void Actor::turn(int dir) { _walking = false; float delta = g_grim->getPerSecond(_turnRate) * dir; diff --git a/engines/grim/actor.h b/engines/grim/actor.h index 9bbd566f11b..7d1b9ac12ef 100644 --- a/engines/grim/actor.h +++ b/engines/grim/actor.h @@ -440,6 +440,8 @@ public: int getTalkChore(int index) const; Costume *getTalkCostume(int index) const; void setMumbleChore(int choreNumber, Costume *cost); + bool playLastWearChore(); + void setLastWearChore(int choreNumber, Costume *cost); void setColormap(const char *map); void pushCostume(const char *name); @@ -628,7 +630,7 @@ private: Chore _talkChore[10]; int _talkAnim; - Chore _mumbleChore; + Chore _mumbleChore, _lastWearChore; Shadow *_shadowArray; int _activeShadowSlot; diff --git a/engines/grim/emi/lua_v2_actor.cpp b/engines/grim/emi/lua_v2_actor.cpp index ac2cdf6539c..c1e87c0b573 100644 --- a/engines/grim/emi/lua_v2_actor.cpp +++ b/engines/grim/emi/lua_v2_actor.cpp @@ -84,6 +84,7 @@ void Lua_V2::PutActorInOverworld() { Actor *actor = getactor(actorObj); actor->setInOverworld(true); + actor->playLastWearChore(); } void Lua_V2::RemoveActorFromOverworld() { @@ -649,6 +650,10 @@ void Lua_V2::PlayActorChore() { } PoolChore *chore = (PoolChore *)costume->getChore(choreName); + if (0 == strncmp("wear_", choreName, 5)) { + actor->setLastWearChore(costume->getChoreId(choreName), costume); + } + if (mode) { costume->playChoreLooping(choreName); } else {