Core/Random: Changed random functions returning doubles to return floats

Port From (https://github.com/TrinityCore/TrinityCore/commit/9894f6b802c974bb36acd7fbb0d083455a1f0f1b)
This commit is contained in:
hondacrx
2024-02-02 14:39:02 -05:00
parent c5538d6d40
commit a5bc0d0d9b
10 changed files with 24 additions and 24 deletions
+3 -3
View File
@@ -28,7 +28,7 @@ namespace Game.Spells
continue;
_effects.EnsureWritableListIndex((uint)spellEffect.EffectIndex, new SpellEffectInfo(this));
_effects[(int)spellEffect.EffectIndex] = new SpellEffectInfo(this, spellEffect);
_effects[spellEffect.EffectIndex] = new SpellEffectInfo(this, spellEffect);
}
// Correct EffectIndex for blank effects
@@ -1007,7 +1007,7 @@ namespace Game.Spells
if (HasAttribute(SpellAttr8.OnlyTargetIfSameCreator))
{
ObjectGuid getCreatorOrSelf(WorldObject obj)
var getCreatorOrSelf = (WorldObject obj) =>
{
ObjectGuid creator = obj.GetCreatorGUID();
if (creator.IsEmpty())
@@ -5005,7 +5005,7 @@ namespace Game.Spells
case SpellTargetDirectionTypes.FrontLeft:
return pi / 4;
case SpellTargetDirectionTypes.Random:
return (float)RandomHelper.NextDouble() * (2 * pi);
return RandomHelper.NextSingle() * (2 * pi);
default:
return 0.0f;
}