Core/Spells: improve random radius calculation by reducing the chance of hitting the center the closer we get (#31811)

* Core/Spells: improve random radius calculation by reducing the chance of lower values the closer we get to the center

* Make GCC happy
This commit is contained in:
Ovahlord
2026-04-21 15:17:31 +02:00
committed by GitHub
parent 20a27b1299
commit ed2a08dc70
+1 -1
View File
@@ -802,7 +802,7 @@ float SpellEffectInfo::CalcRadius(WorldObject* caster /*= nullptr*/, SpellTarget
if (target.GetTarget() == TARGET_DEST_CASTER_RANDOM ||
target.GetTarget() == TARGET_DEST_TARGET_RANDOM ||
target.GetTarget() == TARGET_DEST_DEST_RANDOM)
radius += (entry->RadiusMax - radius) * rand_norm();
radius += (entry->RadiusMax - radius) * std::sqrt(rand_norm());
else if (radius == 0.0f)
radius = entry->RadiusMax;