1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 05:53:50 +00:00

Merge pull request #2679 from elsid/fix_aiwander_start

Fix start position for AiWander random point selection (bug #5262)
This commit is contained in:
Andrei Kortunov 2020-01-29 09:38:07 +04:00 committed by GitHub
commit 92ea66bb21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -330,7 +330,7 @@ namespace MWMechanics
if (!isWaterCreature && !isFlyingCreature) if (!isWaterCreature && !isFlyingCreature)
{ {
// findRandomPointAroundCircle uses wanderDistance as limit for random and not as exact distance // findRandomPointAroundCircle uses wanderDistance as limit for random and not as exact distance
if (const auto destination = navigator->findRandomPointAroundCircle(halfExtents, currentPosition, wanderDistance, navigatorFlags)) if (const auto destination = navigator->findRandomPointAroundCircle(halfExtents, mInitialActorPosition, wanderDistance, navigatorFlags))
mDestination = *destination; mDestination = *destination;
else else
mDestination = getRandomPointAround(mInitialActorPosition, wanderRadius); mDestination = getRandomPointAround(mInitialActorPosition, wanderRadius);