mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 20:22:23 -04:00
Buildsystem/MSVC: Warning fixes
C4800 'type' : forcing value to bool 'true' or 'false' (performance warning) C4127 conditional expression is constant
This commit is contained in:
@@ -522,10 +522,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
CAST_AI(SmartAI, me->AI())->SetCombatMove(_allowMove);
|
||||
}
|
||||
|
||||
me->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED));
|
||||
me->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) != 0);
|
||||
}
|
||||
else if (go)
|
||||
go->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED));
|
||||
go->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) != 0);
|
||||
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_CAST:: %s: %u casts spell %u on target %u with castflags %u",
|
||||
GetLogNameForGuid(me ? me->GetGUID() : go->GetGUID()), me ? me->GetGUIDLow() : go->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
|
||||
@@ -557,7 +557,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS)
|
||||
tempLastInvoker->InterruptNonMeleeSpells(false);
|
||||
|
||||
tempLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED));
|
||||
tempLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) != 0);
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker %u casts spell %u on target %u with castflags %u",
|
||||
tempLastInvoker->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
|
||||
}
|
||||
@@ -707,7 +707,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
CAST_AI(SmartAI, me->AI())->SetAutoAttack(e.action.autoAttack.attack);
|
||||
CAST_AI(SmartAI, me->AI())->SetAutoAttack(e.action.autoAttack.attack != 0);
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: %u bool on = %u",
|
||||
me->GetGUIDLow(), e.action.autoAttack.attack);
|
||||
break;
|
||||
@@ -717,7 +717,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
bool move = e.action.combatMove.move;
|
||||
bool move = e.action.combatMove.move != 0;
|
||||
CAST_AI(SmartAI, me->AI())->SetCombatMove(move);
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature %u bool on = %u",
|
||||
me->GetGUIDLow(), e.action.combatMove.move);
|
||||
@@ -1138,13 +1138,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
case SMART_ACTION_SET_VISIBILITY:
|
||||
{
|
||||
if (me)
|
||||
me->SetVisible(e.action.visibility.state);
|
||||
me->SetVisible(e.action.visibility.state != 0);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_ACTIVE:
|
||||
{
|
||||
if (WorldObject* baseObj = GetBaseObject())
|
||||
baseObj->setActive(e.action.active.state);
|
||||
baseObj->setActive(e.action.active.state != 0);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1320,7 +1320,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
CAST_AI(SmartAI, me->AI())->SetFly(e.action.setFly.fly);
|
||||
CAST_AI(SmartAI, me->AI())->SetFly(e.action.setFly.fly != 0);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_RUN:
|
||||
@@ -1328,7 +1328,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
CAST_AI(SmartAI, me->AI())->SetRun(e.action.setRun.run);
|
||||
CAST_AI(SmartAI, me->AI())->SetRun(e.action.setRun.run != 0);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_SWIM:
|
||||
@@ -1336,7 +1336,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
CAST_AI(SmartAI, me->AI())->SetSwim(e.action.setSwim.swim);
|
||||
CAST_AI(SmartAI, me->AI())->SetSwim(e.action.setSwim.swim != 0);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_WP_START:
|
||||
@@ -1344,9 +1344,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
bool run = e.action.wpStart.run;
|
||||
bool run = e.action.wpStart.run != 0;
|
||||
uint32 entry = e.action.wpStart.pathID;
|
||||
bool repeat = e.action.wpStart.repeat;
|
||||
bool repeat = e.action.wpStart.repeat != 0;
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
StoreTargetList(targets, SMART_ESCORT_TARGETS);
|
||||
me->SetReactState((ReactStates)e.action.wpStart.reactState);
|
||||
@@ -1374,7 +1374,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
uint32 DespawnTime = e.action.wpStop.despawnTime;
|
||||
uint32 quest = e.action.wpStop.quest;
|
||||
bool fail = e.action.wpStop.fail;
|
||||
bool fail = e.action.wpStop.fail != 0;
|
||||
CAST_AI(SmartAI, me->AI())->StopPath(DespawnTime, quest, fail);
|
||||
break;
|
||||
}
|
||||
@@ -1729,7 +1729,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
interruptedSpell = true;
|
||||
}
|
||||
|
||||
unit->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED));
|
||||
unit->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) != 0);
|
||||
}
|
||||
else
|
||||
TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId()));
|
||||
@@ -1899,7 +1899,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsUnit(*itr))
|
||||
(*itr)->ToUnit()->InterruptNonMeleeSpells(e.action.interruptSpellCasting.withDelayed, e.action.interruptSpellCasting.spell_id, e.action.interruptSpellCasting.withInstant);
|
||||
(*itr)->ToUnit()->InterruptNonMeleeSpells(e.action.interruptSpellCasting.withDelayed != 0, e.action.interruptSpellCasting.spell_id, e.action.interruptSpellCasting.withInstant != 0);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2090,7 +2090,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsCreature(*itr))
|
||||
(*itr)->ToCreature()->setRegeneratingHealth(e.action.setHealthRegen.regenHealth);
|
||||
(*itr)->ToCreature()->setRegeneratingHealth(e.action.setHealthRegen.regenHealth != 0);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2103,7 +2103,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsCreature(*itr))
|
||||
(*itr)->ToCreature()->SetControlled(e.action.setRoot.root, UNIT_STATE_ROOT);
|
||||
(*itr)->ToCreature()->SetControlled(e.action.setRoot.root != 0, UNIT_STATE_ROOT);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2612,7 +2612,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
case SMART_TARGET_CLOSEST_ENEMY:
|
||||
{
|
||||
if (me)
|
||||
if (Unit* target = me->SelectNearestTarget(e.target.closestAttackable.maxDist, e.target.closestAttackable.playerOnly))
|
||||
if (Unit* target = me->SelectNearestTarget(e.target.closestAttackable.maxDist, e.target.closestAttackable.playerOnly != 0))
|
||||
l->push_back(target);
|
||||
|
||||
break;
|
||||
@@ -2620,7 +2620,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
case SMART_TARGET_CLOSEST_FRIENDLY:
|
||||
{
|
||||
if (me)
|
||||
if (Unit* target = DoFindClosestFriendlyInRange(e.target.closestFriendly.maxDist, e.target.closestFriendly.playerOnly))
|
||||
if (Unit* target = DoFindClosestFriendlyInRange(e.target.closestFriendly.maxDist, e.target.closestFriendly.playerOnly != 0))
|
||||
l->push_back(target);
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user