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::_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) {