aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI
diff options
context:
space:
mode:
authorsilinoron <none@none>2010-08-22 12:39:39 -0700
committersilinoron <none@none>2010-08-22 12:39:39 -0700
commit5cbae843d58431237a270a0960a5d0c324d5cb1e (patch)
treeedac1313ed45bb5ae3a6375043ef6b08d6490bf6 /src/server/game/AI
parent399e35f8f53aeabcda8af513a37bb855340663e5 (diff)
Core/Game: fix all warnings related to converting doubles and floats.
--HG-- branch : trunk
Diffstat (limited to 'src/server/game/AI')
-rw-r--r--src/server/game/AI/CoreAI/GuardAI.cpp2
-rw-r--r--src/server/game/AI/EventAI/CreatureEventAI.cpp12
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp
index aa609ea0540..43a5af389c3 100644
--- a/src/server/game/AI/CoreAI/GuardAI.cpp
+++ b/src/server/game/AI/CoreAI/GuardAI.cpp
@@ -126,7 +126,7 @@ void GuardAI::UpdateAI(const uint32 /*diff*/)
bool GuardAI::IsVisible(Unit *pl) const
{
- return me->IsWithinDist(pl,sWorld.getConfig(CONFIG_SIGHT_GUARDER))
+ return me->IsWithinDist(pl,(float)sWorld.getConfig(CONFIG_SIGHT_GUARDER))
&& pl->isVisibleForOrDetect(me,true);
}
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp
index 1b5a41a692e..f34564b1389 100644
--- a/src/server/game/AI/EventAI/CreatureEventAI.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp
@@ -216,7 +216,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
if (!me->isInCombat())
return false;
- Unit* pUnit = DoSelectLowestHpFriendly(event.friendly_hp.radius, event.friendly_hp.hpDeficit);
+ Unit* pUnit = DoSelectLowestHpFriendly((float)event.friendly_hp.radius, event.friendly_hp.hpDeficit);
if (!pUnit)
return false;
@@ -232,7 +232,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
std::list<Creature*> pList;
- DoFindFriendlyCC(pList, event.friendly_is_cc.radius);
+ DoFindFriendlyCC(pList, (float)event.friendly_is_cc.radius);
//List is empty
if (pList.empty())
@@ -248,7 +248,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
case EVENT_T_FRIENDLY_MISSING_BUFF:
{
std::list<Creature*> pList;
- DoFindFriendlyMissingBuff(pList, event.friendly_buff.radius, event.friendly_buff.spellId);
+ DoFindFriendlyMissingBuff(pList, (float)event.friendly_buff.radius, event.friendly_buff.spellId);
//List is empty
if (pList.empty())
@@ -763,7 +763,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
}
case ACTION_T_CALL_FOR_HELP:
{
- me->CallForHelp(action.call_for_help.radius);
+ me->CallForHelp((float)action.call_for_help.radius);
break;
}
break;
@@ -772,7 +772,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
case ACTION_T_MOVE_RANDOM_POINT: //dosen't work in combat
{
float x,y,z;
- me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, action.raw.param1);
+ me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)action.raw.param1);
me->GetMotionMaster()->MovePoint(0,x,y,z);
break;
}
@@ -1014,7 +1014,7 @@ void CreatureEventAI::MoveInLineOfSight(Unit *who)
if ((*itr).Event.event_type == EVENT_T_OOC_LOS)
{
//can trigger if closer than fMaxAllowedRange
- float fMaxAllowedRange = (*itr).Event.ooc_los.maxRange;
+ float fMaxAllowedRange = (float)((*itr).Event.ooc_los.maxRange);
//if range is ok and we are actually in LOS
if (me->IsWithinDistInMap(who, fMaxAllowedRange) && me->IsWithinLOSInMap(who))
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index 318a7cf61c4..461442bc909 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -267,7 +267,7 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, uint32 uiSchool, uint32
continue;
//Check if our target is in range
- if (me->IsWithinDistInMap(pTarget, me->GetSpellMinRangeForTarget(pTarget, pTempRange)) || !me->IsWithinDistInMap(pTarget, me->GetSpellMaxRangeForTarget(pTarget, pTempRange)))
+ if (me->IsWithinDistInMap(pTarget, (float)me->GetSpellMinRangeForTarget(pTarget, pTempRange)) || !me->IsWithinDistInMap(pTarget, (float)me->GetSpellMaxRangeForTarget(pTarget, pTempRange)))
continue;
//All good so lets add it to the spell list
@@ -303,7 +303,7 @@ bool ScriptedAI::CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggere
return false;
//Unit is out of range of this spell
- if (me->IsInRange(pTarget, me->GetSpellMinRangeForTarget(pTarget, pTempRange), me->GetSpellMaxRangeForTarget(pTarget, pTempRange)))
+ if (me->IsInRange(pTarget, (float)me->GetSpellMinRangeForTarget(pTarget, pTempRange), (float)me->GetSpellMaxRangeForTarget(pTarget, pTempRange)))
return false;
return true;