mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 11:23:51 +00:00
Store movement vectors as they get returned
This commit is contained in:
parent
4bd1e63ac1
commit
1c604445ba
2 changed files with 12 additions and 11 deletions
|
@ -258,19 +258,15 @@ namespace MWMechanics
|
|||
|
||||
if(!paused)
|
||||
{
|
||||
PtrControllerMap::iterator player(mActors.end());
|
||||
mMovement.reserve(mActors.size());
|
||||
|
||||
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
|
||||
{
|
||||
if(iter->first.getRefData().getHandle() == "player")
|
||||
{
|
||||
/* Make sure player updates last (in case a cell transition occurs) */
|
||||
player = iter;
|
||||
continue;
|
||||
}
|
||||
iter->second.update(duration);
|
||||
Ogre::Vector3 movement = iter->second.update(duration);
|
||||
mMovement.push_back(std::make_pair(iter->first, movement));
|
||||
}
|
||||
if(player != mActors.end())
|
||||
player->second.update(duration);
|
||||
|
||||
mMovement.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,9 +25,14 @@ namespace MWMechanics
|
|||
{
|
||||
typedef std::map<MWWorld::Ptr,CharacterController> PtrControllerMap;
|
||||
PtrControllerMap mActors;
|
||||
float mDuration;
|
||||
|
||||
typedef std::vector<std::pair<MWWorld::Ptr,Ogre::Vector3> > PtrMovementList;
|
||||
PtrMovementList mMovement;
|
||||
|
||||
std::map<std::string, int> mDeathCount;
|
||||
|
||||
float mDuration;
|
||||
|
||||
void updateNpc (const MWWorld::Ptr& ptr, float duration, bool paused);
|
||||
|
||||
void adjustMagicEffects (const MWWorld::Ptr& creature);
|
||||
|
|
Loading…
Reference in a new issue