mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 20:53:53 +00:00
Added check to prevent attempted wandering of empty paths
This commit is contained in:
parent
2b2a51d3b2
commit
2f66b91ac5
1 changed files with 2 additions and 2 deletions
|
@ -473,8 +473,8 @@ namespace MWMechanics
|
||||||
void AiWander::onWalkingStatePerFrameActions(const MWWorld::Ptr& actor,
|
void AiWander::onWalkingStatePerFrameActions(const MWWorld::Ptr& actor,
|
||||||
float duration, AiWanderStorage& storage, ESM::Position& pos)
|
float duration, AiWanderStorage& storage, ESM::Position& pos)
|
||||||
{
|
{
|
||||||
// Are we there yet?
|
// Is there no destination or are we there yet?
|
||||||
if (pathTo(actor, mPathFinder.getPath().back(), duration, DESTINATION_TOLERANCE))
|
if ((!mPathFinder.isPathConstructed()) || pathTo(actor, mPathFinder.getPath().back(), duration, DESTINATION_TOLERANCE))
|
||||||
{
|
{
|
||||||
stopWalking(actor, storage);
|
stopWalking(actor, storage);
|
||||||
storage.setState(Wander_ChooseAction);
|
storage.setState(Wander_ChooseAction);
|
||||||
|
|
Loading…
Reference in a new issue