Fixes #894: Make sure the player's CharacterController is updated when the player is rebuilt. Necessary if the race is changed while we are still in a GUI (e.g. in the review dialog), and an update normally wouldn't occur.

deque
scrawl 11 years ago
parent 386604bc9d
commit e591d23880

@ -781,7 +781,7 @@ namespace MWMechanics
}
}
void Actors::addActor (const MWWorld::Ptr& ptr)
void Actors::addActor (const MWWorld::Ptr& ptr, bool updateImmediately)
{
// erase previous death events since we are currently only tracking them while in an active cell
MWWorld::Class::get(ptr).getCreatureStats(ptr).clearHasDied();
@ -790,6 +790,8 @@ namespace MWMechanics
MWRender::Animation *anim = MWBase::Environment::get().getWorld()->getAnimation(ptr);
mActors.insert(std::make_pair(ptr, new CharacterController(ptr, anim)));
if (updateImmediately)
mActors[ptr]->update(0);
}
void Actors::removeActor (const MWWorld::Ptr& ptr)

@ -58,7 +58,7 @@ namespace MWMechanics
/// paused we may want to do it manually (after equipping permanent enchantment)
void updateMagicEffects (const MWWorld::Ptr& ptr) { adjustMagicEffects(ptr); }
void addActor (const MWWorld::Ptr& ptr);
void addActor (const MWWorld::Ptr& ptr, bool updateImmediately=false);
///< Register an actor for stats management
///
/// \note Dead actors are ignored.

@ -385,7 +385,7 @@ namespace MWMechanics
// have been made for them. Make sure they're properly updated.
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
mActors.removeActor(ptr);
mActors.addActor(ptr);
mActors.addActor(ptr, true);
}
mActors.update(duration, paused);

Loading…
Cancel
Save