mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: Fixed spell effect value truncation when value is a large integer
This commit is contained in:
@@ -479,11 +479,11 @@ bool SpellEffectInfo::IsUnitOwnedAuraEffect() const
|
||||
|
||||
int32 SpellEffectInfo::CalcValue(WorldObject const* caster /*= nullptr*/, int32 const* bp /*= nullptr*/, Unit const* target /*= nullptr*/, float* variance /*= nullptr*/, uint32 castItemId /*= 0*/, int32 itemLevel /*= -1*/) const
|
||||
{
|
||||
float basePointsPerLevel = RealPointsPerLevel;
|
||||
double basePointsPerLevel = RealPointsPerLevel;
|
||||
// TODO: this needs to be a float, not rounded
|
||||
int32 basePoints = CalcBaseValue(caster, target, castItemId, itemLevel);
|
||||
float value = bp ? *bp : basePoints;
|
||||
float comboDamage = PointsPerResource;
|
||||
double value = bp ? *bp : basePoints;
|
||||
double comboDamage = PointsPerResource;
|
||||
|
||||
Unit const* casterUnit = nullptr;
|
||||
if (caster)
|
||||
@@ -492,8 +492,8 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster /*= nullptr*/, int32
|
||||
if (Scaling.Variance)
|
||||
{
|
||||
float delta = fabs(Scaling.Variance * 0.5f);
|
||||
float valueVariance = frand(-delta, delta);
|
||||
value += basePoints * valueVariance;
|
||||
double valueVariance = frand(-delta, delta);
|
||||
value += double(basePoints) * valueVariance;
|
||||
|
||||
if (variance)
|
||||
*variance = valueVariance;
|
||||
|
||||
Reference in New Issue
Block a user