mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
Core/Scripts: fix math error that would not select points on the entire circle
This commit is contained in:
@@ -149,7 +149,7 @@ static inline Position const& GetRandomMinionSpawnPoint()
|
||||
// uniformly distribute on the circle
|
||||
static Position GetRandomPositionOnCircle(Position const& center, float radius)
|
||||
{
|
||||
double angle = rand_norm() * M_2_PI;
|
||||
double angle = rand_norm() * 2.0 * M_PI;
|
||||
double relDistance = rand_norm() + rand_norm();
|
||||
if (relDistance > 1)
|
||||
relDistance = 1 - relDistance;
|
||||
|
||||
Reference in New Issue
Block a user