mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-10 03:40:25 +00:00
EMI: Remember last wear chore, restore it upon entering overworld
This commit is contained in:
parent
71be744000
commit
a5038cd57f
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user