Core/Game: fix all warnings related to converting doubles and floats.
--HG-- branch : trunk
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user