mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-25 21:41:04 +00:00
Merge pull request #2851 from elsid/fix_aiwander_crash
Fix AiWander crash
This commit is contained in:
commit
a4f29a8e37
@ -276,8 +276,7 @@ namespace MWMechanics
|
||||
completeManualWalking(actor, storage);
|
||||
}
|
||||
|
||||
AiWanderStorage::WanderState& wanderState = storage.mState;
|
||||
if ((wanderState == AiWanderStorage::Wander_MoveNow) && storage.mCanWanderAlongPathGrid)
|
||||
if (storage.mState == AiWanderStorage::Wander_MoveNow && storage.mCanWanderAlongPathGrid)
|
||||
{
|
||||
// Construct a new path if there isn't one
|
||||
if(!mPathFinder.isPathConstructed())
|
||||
@ -293,8 +292,10 @@ namespace MWMechanics
|
||||
completeManualWalking(actor, storage);
|
||||
}
|
||||
|
||||
if (wanderState == AiWanderStorage::Wander_Walking
|
||||
&& (isDestinationHidden(actor, mPathFinder.getPath().back())
|
||||
if (storage.mIsWanderingManually
|
||||
&& storage.mState == AiWanderStorage::Wander_Walking
|
||||
&& (mPathFinder.getPathSize() == 0
|
||||
|| isDestinationHidden(actor, mPathFinder.getPath().back())
|
||||
|| isAreaOccupiedByOtherActor(actor, mPathFinder.getPath().back())))
|
||||
completeManualWalking(actor, storage);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user