aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorSpp <none@none>2010-08-21 21:54:41 +0200
committerSpp <none@none>2010-08-21 21:54:41 +0200
commita136403deed39dc7d8523fc7117a070b238992f9 (patch)
tree393e0b5d1f40ccb24c622c429787628ffbdcc00d /src/server/game/Spells
parentc15c605a114179a8b39500b5ef1717c791f60d4f (diff)
Core: Remove "suggest parentheses around ‘&&’ within ‘||’" and "suggest parentheses around assignment used as truth value" warnings
--HG-- branch : trunk
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/Spell.cpp20
-rw-r--r--src/server/game/Spells/SpellMgr.cpp6
2 files changed, 13 insertions, 13 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 5b199560db0..512d1c90f98 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1877,7 +1877,7 @@ void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, SpellNo
Trinity::SpellNotifierCreatureAndPlayer notifier(m_caster, TagUnitMap, radius, type, TargetType, pos, entry);
if ((m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_PLAYERS_ONLY)
- || TargetType == SPELL_TARGETS_ENTRY && !entry)
+ || (TargetType == SPELL_TARGETS_ENTRY && !entry))
m_caster->GetMap()->VisitWorld(pos->m_positionX, pos->m_positionY, radius, notifier);
else
m_caster->GetMap()->VisitAll(pos->m_positionX, pos->m_positionY, radius, notifier);
@@ -2551,13 +2551,13 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
case 51327:
case 51328:
// Search for ghoul if our ghoul or dead body not valid unit target
- if (!(m_targets.getUnitTarget() && (m_targets.getUnitTarget()->GetEntry() == 26125 && m_targets.getUnitTarget()->GetOwnerGUID() == m_caster->GetGUID()
+ if (!(m_targets.getUnitTarget() && ((m_targets.getUnitTarget()->GetEntry() == 26125 && m_targets.getUnitTarget()->GetOwnerGUID() == m_caster->GetGUID())
|| (m_targets.getUnitTarget()->getDeathState() == CORPSE
&& m_targets.getUnitTarget()->GetDisplayId() == m_targets.getUnitTarget()->GetNativeDisplayId()
&& m_targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT
&& !m_targets.getUnitTarget()->ToCreature()->isDeadByDefault()
- && !(m_targets.getUnitTarget()->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL))
- && m_targets.getUnitTarget()->GetDisplayId() == m_targets.getUnitTarget()->GetNativeDisplayId())))
+ && !(m_targets.getUnitTarget()->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL)
+ && m_targets.getUnitTarget()->GetDisplayId() == m_targets.getUnitTarget()->GetNativeDisplayId()))))
{
CleanupTargetList();
@@ -3301,7 +3301,7 @@ void Spell::cast(bool skipCheck)
SendSpellGo();
// Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells
- if (m_spellInfo->speed > 0.0f && !IsChanneledSpell(m_spellInfo) || m_spellInfo->Id == 14157)
+ if ((m_spellInfo->speed > 0.0f && !IsChanneledSpell(m_spellInfo)) || m_spellInfo->Id == 14157)
{
// Remove used for cast item if need (it can be already NULL after TakeReagents call
// in case delayed spell remove item at cast delay start
@@ -4989,7 +4989,7 @@ SpellCastResult Spell::CheckCast(bool strict)
// - with greater than 10 min CD without SPELL_ATTR_EX4_USABLE_IN_ARENA flag
// - with SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA flag
if ((m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA) ||
- GetSpellRecoveryTime(m_spellInfo) > 10 * MINUTE * IN_MILLISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA))
+ (GetSpellRecoveryTime(m_spellInfo) > 10 * MINUTE * IN_MILLISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA)))
if (MapEntry const* mapEntry = sMapStore.LookupEntry(m_caster->GetMapId()))
if (mapEntry->IsBattleArena())
return SPELL_FAILED_NOT_IN_ARENA;
@@ -5360,7 +5360,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_caster->GetTypeId() != TYPEID_PLAYER // only players can open locks, gather etc.
// we need a go target in case of TARGET_GAMEOBJECT
- || m_spellInfo->EffectImplicitTargetA[i] == TARGET_GAMEOBJECT && !m_targets.getGOTarget())
+ || (m_spellInfo->EffectImplicitTargetA[i] == TARGET_GAMEOBJECT && !m_targets.getGOTarget()))
return SPELL_FAILED_BAD_TARGETS;
Item *pTempItem = NULL;
@@ -5378,8 +5378,8 @@ SpellCastResult Spell::CheckCast(bool strict)
(!pTempItem || !pTempItem->GetProto()->LockID || !pTempItem->IsLocked()))
return SPELL_FAILED_BAD_TARGETS;
- if (m_spellInfo->Id != 1842 || m_targets.getGOTarget() &&
- m_targets.getGOTarget()->GetGOInfo()->type != GAMEOBJECT_TYPE_TRAP)
+ if (m_spellInfo->Id != 1842 || (m_targets.getGOTarget() &&
+ m_targets.getGOTarget()->GetGOInfo()->type != GAMEOBJECT_TYPE_TRAP))
if (m_caster->ToPlayer()->InBattleground() && // In Battleground players can use only flags and banners
!m_caster->ToPlayer()->CanUseBattlegroundObject())
return SPELL_FAILED_TRY_AGAIN;
@@ -6745,7 +6745,7 @@ bool Spell::CheckTarget(Unit* target, uint32 eff)
bool Spell::IsNeedSendToClient() const
{
return m_spellInfo->SpellVisual[0] || m_spellInfo->SpellVisual[1] || IsChanneledSpell(m_spellInfo) ||
- m_spellInfo->speed > 0.0f || !m_triggeredByAuraSpell && !m_IsTriggeredSpell;
+ m_spellInfo->speed > 0.0f || (!m_triggeredByAuraSpell && !m_IsTriggeredSpell);
}
bool Spell::HaveTargetsForEffect(uint8 effect) const
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 4f7ad15230d..c0c2632e7e7 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3073,7 +3073,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
return false;
if (questStart) // not in expected required quest state
- if (!player || (!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart))
+ if (!player || ((!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart)))
return false;
if (questEnd) // not in expected forbidden quest state
@@ -3081,7 +3081,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
return false;
if (auraSpell) // not have expected aura
- if (!player || auraSpell > 0 && !player->HasAura(auraSpell) || auraSpell < 0 && player->HasAura(-auraSpell))
+ if (!player || (auraSpell > 0 && !player->HasAura(auraSpell)) || (auraSpell < 0 && player->HasAura(-auraSpell)))
return false;
// Extra conditions -- leaving the possibility add extra conditions...
@@ -3110,7 +3110,7 @@ bool SpellMgr::CanAurasStack(SpellEntry const *spellInfo_1, SpellEntry const *sp
SpellSpecific spellSpec_2 = GetSpellSpecific(spellInfo_2);
if (spellSpec_1 && spellSpec_2)
if (IsSingleFromSpellSpecificPerTarget(spellSpec_1, spellSpec_2)
- || sameCaster && IsSingleFromSpellSpecificPerCaster(spellSpec_1, spellSpec_2))
+ || (sameCaster && IsSingleFromSpellSpecificPerCaster(spellSpec_1, spellSpec_2)))
return false;
SpellGroupStackRule stackRule = CheckSpellGroupStackRules(spellInfo_1->Id, spellInfo_2->Id);