Core/Spells: improve random radius calculation by reducing the chance of hitting the center the closer we get
This commit is contained in:
1 parent
8075d11c5d
commit
71e233eddc
1 file changed
+1
-1
@@ -674,7 +674,7 @@ float SpellEffectInfo::CalcRadius(WorldObject* caster /*= nullptr*/, SpellTarget
|
|||||||
if (target.GetTarget() == TARGET_DEST_CASTER_RANDOM ||
|
if (target.GetTarget() == TARGET_DEST_CASTER_RANDOM ||
|
||||||
target.GetTarget() == TARGET_DEST_TARGET_RANDOM ||
|
target.GetTarget() == TARGET_DEST_TARGET_RANDOM ||
|
||||||
target.GetTarget() == TARGET_DEST_DEST_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)
|
else if (radius == 0.0f)
|
||||||
radius = entry->RadiusMax;
|
radius = entry->RadiusMax;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user