diff options
-rw-r--r-- | src/game/RandomMovementGenerator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp index 754e76d8267..15273843ffc 100644 --- a/src/game/RandomMovementGenerator.cpp +++ b/src/game/RandomMovementGenerator.cpp @@ -54,7 +54,7 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature) MaNGOS::NormalizeMapCoord(nx);
MaNGOS::NormalizeMapCoord(ny);
- dist = distanceX*distanceX + distanceY*distanceY;
+ dist = (nx - X)*(nx - X) + (ny - Y)*(ny - Y);
if (is_air_ok) // 3D system above ground and above water (flying mode)
{
|