forked from teamnwah/openmw-tes3coop
Make sure the player updates last
This commit is contained in:
parent
2f8affc955
commit
5ee298cdc1
1 changed files with 10 additions and 5 deletions
|
@ -258,14 +258,19 @@ namespace MWMechanics
|
||||||
|
|
||||||
if(!paused)
|
if(!paused)
|
||||||
{
|
{
|
||||||
std::vector<std::pair<std::string, Ogre::Vector3> > movement;
|
PtrControllerMap::iterator player(mActors.end());
|
||||||
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
|
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
|
||||||
{
|
{
|
||||||
Ogre::Vector3 vector = iter->second.update(duration);
|
if(iter->first.getRefData().getHandle() == "player")
|
||||||
if(vector!=Ogre::Vector3::ZERO)
|
{
|
||||||
movement.push_back(std::make_pair(iter->first.getRefData().getHandle(), vector));
|
/* Make sure player updates last (in case a cell transition occurs) */
|
||||||
|
player = iter;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
iter->second.update(duration);
|
||||||
}
|
}
|
||||||
MWBase::Environment::get().getWorld()->doPhysics (movement, duration);
|
if(player != mActors.end())
|
||||||
|
player->second.update(duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue