1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:23:52 +00:00

Move AiWander arrival check to time-critical section

This commit is contained in:
scrawl 2014-06-14 20:02:49 +02:00
parent 7afd2ca614
commit afbd5162ee

View file

@ -153,6 +153,17 @@ namespace MWMechanics
}
}
// Are we there yet?
if(mWalking &&
mPathFinder.checkPathCompleted(pos.pos[0], pos.pos[1], pos.pos[2]))
{
stopWalking(actor);
mMoveNow = false;
mWalking = false;
mChooseAction = true;
mHasReturnPosition = false;
}
if(mWalking) // have not yet reached the destination
{
// turn towards the next point in mPath
@ -524,17 +535,6 @@ namespace MWMechanics
}
}
// Are we there yet?
if(mWalking &&
mPathFinder.checkPathCompleted(pos.pos[0], pos.pos[1], pos.pos[2]))
{
stopWalking(actor);
mMoveNow = false;
mWalking = false;
mChooseAction = true;
mHasReturnPosition = false;
}
return false; // AiWander package not yet completed
}