mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 01:36:44 +00:00
Merge pull request #2851 from elsid/fix_aiwander_crash
Fix AiWander crash
This commit is contained in:
commit
a4f29a8e37
1 changed files with 5 additions and 4 deletions
|
@ -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…
Reference in a new issue