aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2014-08-21 16:56:11 +0200
committerjackpoz <giacomopoz@gmail.com>2014-08-23 19:56:41 +0200
commit7fe7f30521503559dc8aee9f3127e11111f8ccc4 (patch)
treef4a75f563e89957d43cef93253bfc300ecf57339 /src/server/game/Spells/Spell.cpp
parentf5f9df0483fbf847eb9ee4e6ec4ecc6cf66d3a47 (diff)
Core/Misc: Fix some -Wconversion warnings
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index cb555bf2954..0f79c4d0780 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -824,7 +824,7 @@ void Spell::SelectSpellTargets()
else if (m_spellInfo->Speed > 0.0f)
{
float dist = m_caster->GetDistance(*m_targets.GetDstPos());
- m_delayMoment = (uint64) floor(dist / m_spellInfo->Speed * 1000.0f);
+ m_delayMoment = (uint64) std::floor(dist / m_spellInfo->Speed * 1000.0f);
}
}
}
@@ -1099,7 +1099,7 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge
SpellTargetObjectTypes objectType = targetType.GetObjectType();
SpellTargetCheckTypes selectionType = targetType.GetCheckType();
ConditionList* condList = m_spellInfo->Effects[effIndex].ImplicitTargetConditions;
- float coneAngle = M_PI/2;
+ float coneAngle = float(M_PI) / 2;
float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster) * m_spellValue->RadiusMod;
if (uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList))
@@ -1472,7 +1472,7 @@ void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTarg
float tangent(float x)
{
- x = tan(x);
+ x = std::tan(x);
//if (x < std::numeric_limits<float>::max() && x > -std::numeric_limits<float>::max()) return x;
//if (x >= std::numeric_limits<float>::max()) return std::numeric_limits<float>::max();
//if (x <= -std::numeric_limits<float>::max()) return -std::numeric_limits<float>::max();
@@ -1577,7 +1577,7 @@ void Spell::SelectImplicitTrajTargets(SpellEffIndex effIndex)
float sqrt1 = b * b + 4 * a * height;
if (sqrt1 > 0)
{
- sqrt1 = sqrt(sqrt1);
+ sqrt1 = std::sqrt(sqrt1);
dist = (sqrt1 - b) / (2 * a);
CHECK_DIST;
}
@@ -1586,7 +1586,7 @@ void Spell::SelectImplicitTrajTargets(SpellEffIndex effIndex)
float sqrt2 = b * b + 4 * a * height;
if (sqrt2 > 0)
{
- sqrt2 = sqrt(sqrt2);
+ sqrt2 = std::sqrt(sqrt2);
dist = (sqrt2 - b) / (2 * a);
CHECK_DIST;
@@ -1615,7 +1615,7 @@ void Spell::SelectImplicitTrajTargets(SpellEffIndex effIndex)
DEBUG_TRAJ(TC_LOG_ERROR("spells", "Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);)
if (distSq > sizeSq)
{
- float factor = 1 - sqrt(sizeSq / distSq);
+ float factor = 1 - std::sqrt(sizeSq / distSq);
x += factor * ((*itr)->GetPositionX() - x);
y += factor * ((*itr)->GetPositionY() - y);
z += factor * ((*itr)->GetPositionZ() - z);
@@ -2076,7 +2076,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
if (dist < 5.0f)
dist = 5.0f;
- targetInfo.timeDelay = (uint64) floor(dist / m_spellInfo->Speed * 1000.0f);
+ targetInfo.timeDelay = (uint64)std::floor(dist / m_spellInfo->Speed * 1000.0f);
// Calculate minimum incoming time
if (m_delayMoment == 0 || m_delayMoment > targetInfo.timeDelay)