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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user