mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 23:21:20 -04:00
Don't allow setting a new return position if there already is one and we haven't reached it yet
This commit is contained in:
parent
1fd7a07b5e
commit
28ef236f0e
@ -341,6 +341,8 @@ namespace MWMechanics
|
|||||||
mChooseAction = false;
|
mChooseAction = false;
|
||||||
mIdleNow = false;
|
mIdleNow = false;
|
||||||
|
|
||||||
|
if (!mPathFinder.isPathConstructed())
|
||||||
|
{
|
||||||
Ogre::Vector3 destNodePos = mReturnPosition;
|
Ogre::Vector3 destNodePos = mReturnPosition;
|
||||||
|
|
||||||
ESM::Pathgrid::Point dest;
|
ESM::Pathgrid::Point dest;
|
||||||
@ -363,6 +365,7 @@ namespace MWMechanics
|
|||||||
mWalking = true;
|
mWalking = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(mChooseAction)
|
if(mChooseAction)
|
||||||
{
|
{
|
||||||
@ -529,6 +532,7 @@ namespace MWMechanics
|
|||||||
mMoveNow = false;
|
mMoveNow = false;
|
||||||
mWalking = false;
|
mWalking = false;
|
||||||
mChooseAction = true;
|
mChooseAction = true;
|
||||||
|
mHasReturnPosition = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false; // AiWander package not yet completed
|
return false; // AiWander package not yet completed
|
||||||
@ -615,7 +619,11 @@ namespace MWMechanics
|
|||||||
|
|
||||||
void AiWander::setReturnPosition(const Ogre::Vector3& position)
|
void AiWander::setReturnPosition(const Ogre::Vector3& position)
|
||||||
{
|
{
|
||||||
mHasReturnPosition = true; mReturnPosition = position;
|
if (!mHasReturnPosition)
|
||||||
|
{
|
||||||
|
mHasReturnPosition = true;
|
||||||
|
mReturnPosition = position;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AiWander::getRandomIdle()
|
void AiWander::getRandomIdle()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user