diff --git a/src/game/ArenaSpectator/ArenaSpectator.h b/src/game/ArenaSpectator/ArenaSpectator.h index d9c9dc6b4..6ba1d63ff 100644 --- a/src/game/ArenaSpectator/ArenaSpectator.h +++ b/src/game/ArenaSpectator/ArenaSpectator.h @@ -205,8 +205,12 @@ namespace ArenaSpectator if (effMask & (1<GetEffect(i)->GetAuraType(); - if (aura->GetEffect(i)->GetAmount() && (aura->GetSpellInfo()->IsPositive() || targetGUID != aura->GetCasterGUID()) || - at == SPELL_AURA_MECHANIC_IMMUNITY || at == SPELL_AURA_EFFECT_IMMUNITY || at == SPELL_AURA_STATE_IMMUNITY || at == SPELL_AURA_SCHOOL_IMMUNITY || at == SPELL_AURA_DISPEL_IMMUNITY) + if ((aura->GetEffect(i)->GetAmount() && (aura->GetSpellInfo()->IsPositive() || targetGUID != aura->GetCasterGUID())) || + at == SPELL_AURA_MECHANIC_IMMUNITY || + at == SPELL_AURA_EFFECT_IMMUNITY || + at == SPELL_AURA_STATE_IMMUNITY || + at == SPELL_AURA_SCHOOL_IMMUNITY || + at == SPELL_AURA_DISPEL_IMMUNITY) return true; } } diff --git a/src/game/Battlegrounds/BattlegroundQueue.cpp b/src/game/Battlegrounds/BattlegroundQueue.cpp index 387489b68..4e369d67c 100644 --- a/src/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/game/Battlegrounds/BattlegroundQueue.cpp @@ -390,8 +390,8 @@ void BattlegroundQueue::FillPlayersToBG(const int32 aliFree, const int32 hordeFr // quick check if nothing we can do: if (!sBattlegroundMgr->isTesting()) - if (aliFree > hordeFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty() || - hordeFree > aliFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty()) + if ((aliFree > hordeFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty()) || + (hordeFree > aliFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty())) return; // ally: at first fill as much as possible @@ -446,8 +446,8 @@ void BattlegroundQueue::FillPlayersToBGWithSpecific(const int32 aliFree, const i // quick check if nothing we can do: if (!sBattlegroundMgr->isTesting()) - if (m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty() || - m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_HORDE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_HORDE].empty()) + if ((m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty()) || + (m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_HORDE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_HORDE].empty())) return; // copy groups from both queues to new joined container diff --git a/src/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/game/Battlegrounds/Zones/BattlegroundRV.cpp index 9c149e496..0ef08b2d5 100644 --- a/src/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -59,7 +59,8 @@ void BattlegroundRV::CheckPositionForUnit(Unit* unit) { float groundZ_vmap = unit->GetMap()->GetHeight(unit->GetPositionX(), unit->GetPositionY(), 37.0f, true, 50.0f); float groundZ_dyntree = unit->GetMap()->GetDynamicMapTree().getHeight(unit->GetPositionX(), unit->GetPositionY(), 37.0f, 50.0f, unit->GetPhaseMask()); - if (groundZ_vmap > 28.0f && groundZ_vmap < 29.0f || groundZ_dyntree > 28.0f && groundZ_dyntree < 37.0f) + if ((groundZ_vmap > 28.0f && groundZ_vmap < 29.0f) || + (groundZ_dyntree > 28.0f && groundZ_dyntree < 37.0f)) { float groundZ = std::max(groundZ_vmap, groundZ_dyntree); if (unit->GetPositionZ() < groundZ - 0.2f || unit->GetPositionZ() > groundZ + 3.5f) diff --git a/src/game/Chat/Channels/Channel.cpp b/src/game/Chat/Channels/Channel.cpp index 6f059455a..73c76536a 100644 --- a/src/game/Chat/Channels/Channel.cpp +++ b/src/game/Chat/Channels/Channel.cpp @@ -392,7 +392,8 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b return; } - if (ban && (_channelRights.flags & CHANNEL_RIGHT_CANT_BAN) || !ban && (_channelRights.flags & CHANNEL_RIGHT_CANT_KICK)) + if ((ban && (_channelRights.flags & CHANNEL_RIGHT_CANT_BAN)) || + (!ban && (_channelRights.flags & CHANNEL_RIGHT_CANT_KICK))) { WorldPacket data; MakeNotModerator(&data); @@ -660,8 +661,8 @@ void Channel::SetOwner(Player const* player, std::string const& newname) Player* newp = ObjectAccessor::FindPlayerByName(newname, false); uint64 victim = newp ? newp->GetGUID() : 0; - if (!victim || !IsOn(victim) || newp->GetTeamId() != player->GetTeamId() && - !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) + if (!victim || !IsOn(victim) || + (newp->GetTeamId() != player->GetTeamId() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))) { WorldPacket data; MakePlayerNotFound(&data, newname); diff --git a/src/game/Entities/Object/Object.cpp b/src/game/Entities/Object/Object.cpp index 8c4d649a7..e49db9cb0 100644 --- a/src/game/Entities/Object/Object.cpp +++ b/src/game/Entities/Object/Object.cpp @@ -2093,7 +2093,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert summon->SetHomePosition(pos); summon->InitStats(duration); - AddToMap(summon->ToCreature(), (IS_PLAYER_GUID(summon->GetOwnerGUID()) || summoner && summoner->GetTransport())); + AddToMap(summon->ToCreature(), (IS_PLAYER_GUID(summon->GetOwnerGUID()) || (summoner && summoner->GetTransport()))); summon->InitSummon(); //ObjectAccessor::UpdateObjectVisibility(summon); diff --git a/src/game/Entities/Player/Player.cpp b/src/game/Entities/Player/Player.cpp index 973f682b4..5986278b1 100644 --- a/src/game/Entities/Player/Player.cpp +++ b/src/game/Entities/Player/Player.cpp @@ -4200,8 +4200,8 @@ void Player::removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporar continue; // pussywizard: don't understand why whole skill is removed when just single spell from it is removed - if (_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL && pSkill->categoryId != SKILL_CATEGORY_CLASS || // pussywizard: don't unlearn class skills - (pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0) + if ((_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL && pSkill->categoryId != SKILL_CATEGORY_CLASS) || // pussywizard: don't unlearn class skills + ((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0)) { // not reset skills for professions and racial abilities if ((pSkill->categoryId == SKILL_CATEGORY_SECONDARY || pSkill->categoryId == SKILL_CATEGORY_PROFESSION) && (IsProfessionSkill(pSkill->id) || _spell_idx->second->racemask != 0)) @@ -17494,7 +17494,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); // pussywizard: group changed difficulty when player was offline, teleport to the enterance of new difficulty - if (mapEntry && (mapEntry->IsNonRaidDungeon() && dungeonDiff != GetDungeonDifficulty() || mapEntry->IsRaid() && raidDiff != GetRaidDifficulty())) + if (mapEntry && ((mapEntry->IsNonRaidDungeon() && dungeonDiff != GetDungeonDifficulty()) || + (mapEntry->IsRaid() && raidDiff != GetRaidDifficulty()))) { bool fixed = false; if (uint32 destInstId = sInstanceSaveMgr->PlayerGetDestinationInstanceId(this, mapId, GetDifficulty(mapEntry->IsRaid()))) @@ -22840,7 +22841,9 @@ void Player::ApplyEquipCooldown(Item* pItem) // xinef: dont apply equip cooldown if spell on item has insignificant cooldown SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId); - if (spellData.SpellCooldown <= 3000 && spellData.SpellCategoryCooldown <= 3000 && (!spellInfo || spellInfo->RecoveryTime <= 3000 && spellInfo->CategoryRecoveryTime <= 3000)) + if (spellData.SpellCooldown <= 3000 && + spellData.SpellCategoryCooldown <= 3000 && + (!spellInfo || (spellInfo->RecoveryTime <= 3000 && spellInfo->CategoryRecoveryTime <= 3000))) continue; // Don't replace longer cooldowns by equip cooldown if we have any. @@ -26371,7 +26374,10 @@ uint8 Player::GetMostPointsTalentTree() const bool Player::IsHealerTalentSpec() const { uint8 tree = GetMostPointsTalentTree(); - return (getClass() == CLASS_DRUID && tree == 2 || getClass() == CLASS_PALADIN && tree == 0 || getClass() == CLASS_PRIEST && tree <= 1 || getClass() == CLASS_SHAMAN && tree == 2); + return ((getClass() == CLASS_DRUID && tree == 2) || + (getClass() == CLASS_PALADIN && tree == 0) || + (getClass() == CLASS_PRIEST && tree <= 1) || + (getClass() == CLASS_SHAMAN && tree == 2)); } void Player::ResetTimeSync() diff --git a/src/game/Entities/Unit/Unit.cpp b/src/game/Entities/Unit/Unit.cpp index 4d2757662..ae9ead76e 100644 --- a/src/game/Entities/Unit/Unit.cpp +++ b/src/game/Entities/Unit/Unit.cpp @@ -3379,13 +3379,16 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const else if (c->GetMapId() == 631) // Icecrown Citadel { // if static transport doesn't match - return false - if (c->GetTransport() != this->GetTransport() && (c->GetTransport() && c->GetTransport()->IsStaticTransport() || this->GetTransport() && this->GetTransport()->IsStaticTransport())) + if (c->GetTransport() != this->GetTransport() && + ((c->GetTransport() && c->GetTransport()->IsStaticTransport()) || + (this->GetTransport() && this->GetTransport()->IsStaticTransport()))) return false; // special handling for ICC (map 631), for non-flying pets in Gunship Battle, for trash npcs this is done via CanAIAttack if (IS_PLAYER_GUID(c->GetOwnerGUID()) && !c->CanFly()) { - if (c->GetTransport() && !this->GetTransport() || !c->GetTransport() && this->GetTransport()) + if ((c->GetTransport() && !this->GetTransport()) || + (!c->GetTransport() && this->GetTransport())) return false; if (this->GetTransport()) { @@ -3670,7 +3673,7 @@ void Unit::HandleSafeUnitPointersOnDelete(Unit* thisUnit) bool Unit::IsInWater(bool allowAbove) const { const_cast(this)->UpdateEnvironmentIfNeeded(1); - return m_last_isinwater_status || allowAbove && m_last_islittleabovewater_status; + return m_last_isinwater_status || (allowAbove && m_last_islittleabovewater_status); } bool Unit::IsUnderWater() const @@ -10385,7 +10388,8 @@ float Unit::SpellPctDamageModsDone(Unit* victim, SpellInfo const* spellProto, Da // Merciless Combat if ((*i)->GetSpellInfo()->SpellIconID == 2656) { - if( spellProto && spellProto->SpellFamilyFlags[0] & 0x2 || spellProto->SpellFamilyFlags[1] & 0x2 ) + if (spellProto && + ((spellProto->SpellFamilyFlags[0] & 0x2) || (spellProto->SpellFamilyFlags[1] & 0x2))) if (!victim->HealthAbovePct(35)) AddPct(DoneTotalMod, (*i)->GetAmount()); } diff --git a/src/game/Entities/Unit/Unit.h b/src/game/Entities/Unit/Unit.h index c7cd3e746..52e1da4bb 100644 --- a/src/game/Entities/Unit/Unit.h +++ b/src/game/Entities/Unit/Unit.h @@ -2379,7 +2379,13 @@ class Unit : public WorldObject // pussywizard: // MMaps std::map m_targetsNotAcceptable; - bool isTargetNotAcceptableByMMaps(uint64 guid, uint32 currTime, const Position* t = NULL) const { std::map::const_iterator itr = m_targetsNotAcceptable.find(guid); if (itr != m_targetsNotAcceptable.end() && (itr->second._endTime >= currTime || t && !itr->second.PosChanged(*this, *t))) return true; return false; } + bool isTargetNotAcceptableByMMaps(uint64 guid, uint32 currTime, const Position* t = NULL) const { + std::map::const_iterator itr = m_targetsNotAcceptable.find(guid); + if ((itr != m_targetsNotAcceptable.end() && (itr->second._endTime >= currTime)) || + (t && !itr->second.PosChanged(*this, *t))) + return true; + return false; + } uint32 m_mmapNotAcceptableStartTime; // Safe mover std::set SafeUnitPointerSet; diff --git a/src/game/Groups/Group.cpp b/src/game/Groups/Group.cpp index 2fa1c60fc..face715dd 100644 --- a/src/game/Groups/Group.cpp +++ b/src/game/Groups/Group.cpp @@ -1362,7 +1362,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap) continue; player = ObjectAccessor::FindPlayer(itr->first); - if (!player || allowedMap != NULL && player->FindMap() != allowedMap) + if (!player || (allowedMap != NULL && player->FindMap() != allowedMap)) { --roll->totalNeed; continue; @@ -1426,7 +1426,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap) continue; player = ObjectAccessor::FindPlayer(itr->first); - if (!player || allowedMap != NULL && player->FindMap() != allowedMap) + if (!player || (allowedMap != NULL && player->FindMap() != allowedMap)) { --roll->totalGreed; continue; diff --git a/src/game/Handlers/CharacterHandler.cpp b/src/game/Handlers/CharacterHandler.cpp index c7fb4da79..6c825ca72 100644 --- a/src/game/Handlers/CharacterHandler.cpp +++ b/src/game/Handlers/CharacterHandler.cpp @@ -2085,8 +2085,11 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) // xinef: check money bool valid = Player::TeamIdForRace(oldRace) == Player::TeamIdForRace(race); - if (level < 10 && money <= 0 || level > 10 && level <= 30 && money <= 3000000 || level > 30 && level <= 50 && money <= 10000000 || - level > 50 && level <= 70 && money <= 50000000 || level > 70 && money <= 200000000) + if ((level < 10 && money <= 0) || + (level > 10 && level <= 30 && money <= 3000000) || + (level > 30 && level <= 50 && money <= 10000000) || + (level > 50 && level <= 70 && money <= 50000000) || + (level > 70 && money <= 200000000)) valid = true; if (!valid) { diff --git a/src/game/Handlers/MiscHandler.cpp b/src/game/Handlers/MiscHandler.cpp index 76e970dbf..55a4ed0aa 100644 --- a/src/game/Handlers/MiscHandler.cpp +++ b/src/game/Handlers/MiscHandler.cpp @@ -410,7 +410,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) if (uint64 lguid = GetPlayer()->GetLootGUID()) DoLootRelease(lguid); - bool instantLogout = (GetSecurity() >= sWorld->getIntConfig(CONFIG_INSTANT_LOGOUT) || GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat()) || GetPlayer()->IsInFlight(); + bool instantLogout = (GetSecurity() >= sWorld->getIntConfig(CONFIG_INSTANT_LOGOUT) || (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat())) || GetPlayer()->IsInFlight(); /// TODO: Possibly add RBAC permission to log out in combat bool canLogoutInCombat = GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); @@ -1532,7 +1532,17 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) return; } - if (!groupGuy->IsAlive() || groupGuy->IsInCombat() || groupGuy->GetVictim() || groupGuy->m_mover != groupGuy || groupGuy->IsNonMeleeSpellCast(true) || !groupGuy->GetMotionMaster()->empty() && groupGuy->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE || !groupGuy->movespline->Finalized() || !groupGuy->GetMap()->ToInstanceMap() || !groupGuy->GetMap()->ToInstanceMap()->GetInstanceScript() || groupGuy->GetMap()->ToInstanceMap()->GetInstanceScript()->IsEncounterInProgress() || !groupGuy->Satisfy(sObjectMgr->GetAccessRequirement(groupGuy->GetMap()->GetId(), Difficulty(mode)), groupGuy->GetMap()->GetId(), false)) + if (!groupGuy->IsAlive() || + groupGuy->IsInCombat() || + groupGuy->GetVictim() || + groupGuy->m_mover != groupGuy || + groupGuy->IsNonMeleeSpellCast(true) || + (!groupGuy->GetMotionMaster()->empty() && groupGuy->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) || + !groupGuy->movespline->Finalized() || + !groupGuy->GetMap()->ToInstanceMap() || + !groupGuy->GetMap()->ToInstanceMap()->GetInstanceScript() || + groupGuy->GetMap()->ToInstanceMap()->GetInstanceScript()->IsEncounterInProgress() || + !groupGuy->Satisfy(sObjectMgr->GetAccessRequirement(groupGuy->GetMap()->GetId(), Difficulty(mode)), groupGuy->GetMap()->GetId(), false)) { _player->SendRaidDifficulty(group != NULL); return; @@ -1556,7 +1566,17 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) if (Player* p = itr->GetSource()) if (p->GetGroup() != group) { - if (!p->IsInWorld() || !p->IsAlive() || p->IsInCombat() || p->GetVictim() || p->m_mover != p || p->IsNonMeleeSpellCast(true) || !p->GetMotionMaster()->empty() && p->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE || !p->movespline->Finalized() || !p->GetMap()->ToInstanceMap() || !p->GetMap()->ToInstanceMap()->GetInstanceScript() || p->GetMap()->ToInstanceMap()->GetInstanceScript()->IsEncounterInProgress()) + if (!p->IsInWorld() || + !p->IsAlive() || + p->IsInCombat() || + p->GetVictim() || + p->m_mover != p || + p->IsNonMeleeSpellCast(true) || + (!p->GetMotionMaster()->empty() && p->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) || + !p->movespline->Finalized() || + !p->GetMap()->ToInstanceMap() || + !p->GetMap()->ToInstanceMap()->GetInstanceScript() || + p->GetMap()->ToInstanceMap()->GetInstanceScript()->IsEncounterInProgress()) { _player->SendRaidDifficulty(group != NULL); return; diff --git a/src/game/Movement/MovementGenerators/PathGenerator.cpp b/src/game/Movement/MovementGenerators/PathGenerator.cpp index d70ff2b57..90d2fd52a 100644 --- a/src/game/Movement/MovementGenerators/PathGenerator.cpp +++ b/src/game/Movement/MovementGenerators/PathGenerator.cpp @@ -227,8 +227,8 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con } if (sourceCanSwim) { - if (startPoly == INVALID_POLYREF && LIQUID_MAP_NO_WATER == _sourceUnit->GetBaseMap()->getLiquidStatus(startPos.x, startPos.y, startPos.z, MAP_ALL_LIQUIDS, NULL) || - endPoly == INVALID_POLYREF && LIQUID_MAP_NO_WATER == _sourceUnit->GetBaseMap()->getLiquidStatus(endPos.x, endPos.y, endPos.z, MAP_ALL_LIQUIDS, NULL)) + if ((startPoly == INVALID_POLYREF && LIQUID_MAP_NO_WATER == _sourceUnit->GetBaseMap()->getLiquidStatus(startPos.x, startPos.y, startPos.z, MAP_ALL_LIQUIDS, NULL)) || + (endPoly == INVALID_POLYREF && LIQUID_MAP_NO_WATER == _sourceUnit->GetBaseMap()->getLiquidStatus(endPos.x, endPos.y, endPos.z, MAP_ALL_LIQUIDS, NULL))) { _type = PATHFIND_NOPATH; return; diff --git a/src/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 09649f947..c7f0e101c 100644 --- a/src/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -137,7 +137,8 @@ void RandomMovementGenerator::_setRandomLocation(Creature* creature) zDiff = fabs((*itr).z - (*itrNext).z); // Xinef: tree climbing, cut as much as we can - if (zDiff > 2.0f || G3D::fuzzyNe(zDiff, 0.0f) && distDiff / zDiff < 2.15f) // ~25° + if (zDiff > 2.0f || + (G3D::fuzzyNe(zDiff, 0.0f) && distDiff / zDiff < 2.15f)) // ~25� { _validPointsVector[_currentPoint].erase(randomIter); _preComputedPaths.erase(pathIdx); diff --git a/src/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 0406861c7..c52e1bc9b 100644 --- a/src/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -132,7 +132,9 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T* owner, bool ini Position dest = {x, y, z, 0.0f}; if (GameObject* pillar = ((BattlegroundRV*)bg)->GetPillarAtPosition(&dest)) { - if (pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() == 0 || owner->GetPositionZ() > 31.0f || owner->GetTransGUID() == pillar->GetGUID()) + if ((pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() == 0) || + owner->GetPositionZ() > 31.0f || + owner->GetTransGUID() == pillar->GetGUID()) { if (pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() == 0) z = std::max(z, 28.28f); @@ -146,7 +148,8 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T* owner, bool ini init.Launch(); return; } - if (pillar->GetGoState() == GO_STATE_ACTIVE || pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() > 0) + if (pillar->GetGoState() == GO_STATE_ACTIVE || + (pillar->GetGoState() == GO_STATE_READY && pillar->ToTransport()->GetPathProgress() > 0)) { Position pos; owner->GetFirstCollisionPositionForTotem(pos, owner->GetExactDist2d(i_target.getTarget()), owner->GetAngle(i_target.getTarget())-owner->GetOrientation(), false); @@ -169,7 +172,8 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T* owner, bool ini if (result) { float maxDist = MELEE_RANGE + owner->GetMeleeReach() + i_target->GetMeleeReach(); - if (!forceDest && (i_path->GetPathType() & PATHFIND_NOPATH || !i_offset && !isPlayerPet && i_target->GetExactDistSq(i_path->GetActualEndPosition().x, i_path->GetActualEndPosition().y, i_path->GetActualEndPosition().z) > maxDist*maxDist)) + if ((!forceDest && (i_path->GetPathType() & PATHFIND_NOPATH)) || + (!i_offset && !isPlayerPet && i_target->GetExactDistSq(i_path->GetActualEndPosition().x, i_path->GetActualEndPosition().y, i_path->GetActualEndPosition().z) > maxDist*maxDist)) { lastPathingFailMSTime = World::GetGameTimeMS(); owner->m_targetsNotAcceptable[i_target->GetGUID()] = MMapTargetData(sWorld->GetGameTime()+DISALLOW_TIME_AFTER_FAIL, owner, i_target.getTarget()); diff --git a/src/game/Server/WorldSession.cpp b/src/game/Server/WorldSession.cpp index a2690005d..3b5e0e79e 100644 --- a/src/game/Server/WorldSession.cpp +++ b/src/game/Server/WorldSession.cpp @@ -879,8 +879,10 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) */ // pussywizard: remade this condition - bool canFly = GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) || GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || - GetPlayer()->m_mover->GetTypeId() == TYPEID_UNIT && GetPlayer()->m_mover->ToCreature()->CanFly() || GetSecurity() > SEC_PLAYER; + bool canFly = GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) || + GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || + (GetPlayer()->m_mover->GetTypeId() == TYPEID_UNIT && GetPlayer()->m_mover->ToCreature()->CanFly()) || + GetSecurity() > SEC_PLAYER; REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && !canFly, MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY); diff --git a/src/game/Spells/Auras/SpellAuras.cpp b/src/game/Spells/Auras/SpellAuras.cpp index d12ab7071..faaf51f2c 100644 --- a/src/game/Spells/Auras/SpellAuras.cpp +++ b/src/game/Spells/Auras/SpellAuras.cpp @@ -864,7 +864,8 @@ void Aura::RefreshTimersWithMods() { Unit* caster = GetCaster(); m_maxDuration = CalcMaxDuration(); - if (caster && caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION)) + if ((caster && caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo)) || + m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION)) m_maxDuration = int32(m_maxDuration * caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); // xinef: we should take ModSpellDuration into account, but none of the spells using this function is affected by contents of ModSpellDuration diff --git a/src/scripts/Commands/cs_spectator.cpp b/src/scripts/Commands/cs_spectator.cpp index 07a1e75e7..e192d68b3 100644 --- a/src/scripts/Commands/cs_spectator.cpp +++ b/src/scripts/Commands/cs_spectator.cpp @@ -182,8 +182,8 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c } bool bgPreparation = false; - if (!handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS || - handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_WAIT_JOIN && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS) + if ((!handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS) || + (handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_WAIT_JOIN && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS)) { bgPreparation = true; handler->SendSysMessage("Arena is not in progress yet. You will be invited as soon as it starts."); diff --git a/src/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index 867f51043..7cfd5f30a 100644 --- a/src/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -394,8 +394,8 @@ public: { if (pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_NONE) { - if (me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 192.0f && me->GetPositionY() < 206.0f || - me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 240.0f && me->GetPositionY() < 254.0f) + if ((me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 192.0f && me->GetPositionY() < 206.0f) || + (me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 240.0f && me->GetPositionY() < 254.0f)) { isInvincible = true; if (SPELL_NECROLYTE_CHANNELING) diff --git a/src/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index 546876fae..a8278209c 100644 --- a/src/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -158,8 +158,13 @@ class boss_festergut : public CreatureScript else if (Player* p = target->ToPlayer()) { // Gaseous Blight damage - if ((spell->Id == 69159 || spell->Id == 70136 || spell->Id == 69161 || spell->Id == 70139 || spell->Id == 69163 || spell->Id == 70469) && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_10) == QUEST_STATUS_INCOMPLETE || - (spell->Id == 70135 || spell->Id == 70138 || spell->Id == 70468 || spell->Id == 70137 || spell->Id == 70140 || spell->Id == 70470) && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_25) == QUEST_STATUS_INCOMPLETE) + if ((spell->Id == 69159 || + spell->Id == 70136 || + spell->Id == 69161 || + spell->Id == 70139 || + spell->Id == 69163 || + (spell->Id == 70469 && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_10) == QUEST_STATUS_INCOMPLETE)) || + ((spell->Id == 70135 || spell->Id == 70138 || spell->Id == 70468 || spell->Id == 70137 || spell->Id == 70140 || spell->Id == 70470) && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_25) == QUEST_STATUS_INCOMPLETE)) p->CastSpell(p, SPELL_ORANGE_BLIGHT_RESIDUE, true); } } diff --git a/src/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 70a786947..24e6d6394 100644 --- a/src/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -982,7 +982,8 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader std::list creList; GetCreatureListWithEntryInGrid(creList, GetCaster(), NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 200.0f); for (std::list::iterator itr = creList.begin(); itr != creList.end(); ++itr) - if ((*itr)->GetPositionX() > 4350.0f && stage == 0 || (*itr)->GetPositionX() < 4350.0f && stage == 1) + if (((*itr)->GetPositionX() > 4350.0f && stage == 0) || + ((*itr)->GetPositionX() < 4350.0f && stage == 1)) { target = (*itr); break; diff --git a/src/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index b4b29a62e..00adedb8d 100644 --- a/src/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -881,9 +881,14 @@ public: if (p->getClass() == CLASS_HUNTER) return true; uint8 maxIndex = p->GetMostPointsTalentTree(); - if (p->getClass() == CLASS_PALADIN && maxIndex >= 1 || p->getClass() == CLASS_SHAMAN && maxIndex == 1 || p->getClass() == CLASS_DRUID && maxIndex == 1) + if ((p->getClass() == CLASS_PALADIN && maxIndex >= 1) || + (p->getClass() == CLASS_SHAMAN && maxIndex == 1) || + (p->getClass() == CLASS_DRUID && maxIndex == 1)) return true; - if (_removeHealers == (p->getClass() == CLASS_DRUID && maxIndex == 2 || p->getClass() == CLASS_PALADIN && maxIndex == 0 || p->getClass() == CLASS_PRIEST && maxIndex <= 1 || p->getClass() == CLASS_SHAMAN && maxIndex == 2)) + if (_removeHealers == (p->getClass() == CLASS_DRUID && maxIndex == 2) || + (p->getClass() == CLASS_PALADIN && maxIndex == 0) || + (p->getClass() == CLASS_PRIEST && maxIndex <= 1) || + (p->getClass() == CLASS_SHAMAN && maxIndex == 2)) return true; return false; diff --git a/src/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index deeef24de..c9dbda389 100644 --- a/src/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -377,7 +377,8 @@ public: return false; if (_maxDist && _source->GetExactDist(target) > _maxDist) return false; - if (_exclude1 && target->HasAura(_exclude1) || _exclude2 && target->HasAura(_exclude2)) + if ((_exclude1 && target->HasAura(_exclude1)) || + (_exclude2 && target->HasAura(_exclude2))) return false; if (_reqLOS && !_source->IsWithinLOSInMap(target)) return false; @@ -1238,7 +1239,8 @@ class npc_tirion_fordring_tft : public CreatureScript void Reset() { _events.Reset(); - if (_instance->GetBossState(DATA_THE_LICH_KING) == DONE || me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE)) + if (_instance->GetBossState(DATA_THE_LICH_KING) == DONE || + (me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE))) me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetReactState(REACT_PASSIVE); } @@ -1310,7 +1312,8 @@ class npc_tirion_fordring_tft : public CreatureScript void JustReachedHome() { ScriptedAI::JustReachedHome(); - if (!(_instance->GetBossState(DATA_THE_LICH_KING) == DONE || me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE))) + if (!(_instance->GetBossState(DATA_THE_LICH_KING) == DONE || + (me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE)))) me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); } diff --git a/src/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 00495855a..1fd988dae 100644 --- a/src/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -3231,7 +3231,8 @@ public: --currPipeWP; } me->SetHomePosition(VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ(), me->GetOrientation()); - if (forward && currPipeWP == 3 || !forward && currPipeWP == 2) + if ((forward && currPipeWP == 3) || + (!forward && currPipeWP == 2)) me->GetMotionMaster()->MoveJump(VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ(), 10.0f, 6.0f, 1); else me->GetMotionMaster()->MovePoint(1, VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ()); @@ -3275,7 +3276,8 @@ public: bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { - if (creature->GetEntry() == NPC_GARROSH_HELLSCREAM && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11206 || creature->GetEntry() == NPC_KING_VARIAN_WRYNN && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11204) + if ((creature->GetEntry() == NPC_GARROSH_HELLSCREAM && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11206) || + (creature->GetEntry() == NPC_KING_VARIAN_WRYNN && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11204)) { if (!player->GetGroup() || !player->GetGroup()->isRaidGroup() || !player->GetGroup()->IsLeader(player->GetGUID())) { diff --git a/src/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 951e613b2..22fc2aee9 100644 --- a/src/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -526,7 +526,8 @@ class instance_icecrown_citadel : public InstanceMapScript return entry; return 0; case NPC_SPIRE_FROSTWYRM: - if (TeamIdInInstance == TEAM_ALLIANCE && data->posY < 2200.0f || TeamIdInInstance == TEAM_HORDE && data->posY > 2200.0f) + if ((TeamIdInInstance == TEAM_ALLIANCE && data->posY < 2200.0f) || + (TeamIdInInstance == TEAM_HORDE && data->posY > 2200.0f)) return 0; break; } diff --git a/src/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index c15969d45..1a0ce01d2 100644 --- a/src/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -275,11 +275,9 @@ class boss_algalon_the_observer : public CreatureScript { if (!item) // should not happen, but checked in GetAverageItemLevel() return true; - if (item->ItemLevel <= 226 || item->ItemLevel <= 232 && ( - item->InventoryType == INVTYPE_SHIELD || - item->Class == ITEM_CLASS_WEAPON || - item->Class == ITEM_CLASS_ARMOR && (item->InventoryType == INVTYPE_RELIC || item->InventoryType == INVTYPE_HOLDABLE) - )) + if (item->ItemLevel <= 226 || (item->ItemLevel <= 232 && (item->InventoryType == INVTYPE_SHIELD || + item->Class == ITEM_CLASS_WEAPON || + (item->Class == ITEM_CLASS_ARMOR && (item->InventoryType == INVTYPE_RELIC || item->InventoryType == INVTYPE_HOLDABLE))))) return true; return false; } diff --git a/src/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 79d4a7c5a..286d30f98 100644 --- a/src/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -470,8 +470,8 @@ public: if( faction ) for( uint8 k=0; k<4; ++k ) { - if( faction == 'A' && ( k>1 || k==1 && RAID_MODE(1,0) ) || - faction == 'H' && ( k<2 || k==3 && RAID_MODE(1,0) ) ) + if((faction == 'A' && ( k>1 || (k==1 && RAID_MODE(1,0)) )) || + (faction == 'H' && ( k<2 || (k==3 && RAID_MODE(1,0)) )) ) continue; for( uint8 i=0; i<4; ++i ) @@ -639,7 +639,8 @@ public: if (me->IsSummon()) if (Unit* s = me->ToTempSummon()->GetSummoner()) { - if (s->GetTypeId() == TYPEID_PLAYER && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER) || s->GetTypeId() == TYPEID_UNIT && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC)) + if ((s->GetTypeId() == TYPEID_PLAYER && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER)) || + (s->GetTypeId() == TYPEID_UNIT && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))) me->DespawnOrUnsummon(2000); else if (s->GetTypeId() == TYPEID_PLAYER) if (InstanceScript* pInstance = me->GetInstanceScript()) diff --git a/src/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 88626d9f6..dbdb31df4 100644 --- a/src/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -484,7 +484,7 @@ public: if (!summon || summon->GetEntry() != NPC_OMINOUS_CLOUD || me->GetDistance(summon) < 20) continue; - if ((!cloud || urand(0,1) && !summon->HasAura(SPELL_SUMMON_GUARDIAN_OF_YS))) + if ((!cloud || (urand(0,1) && !summon->HasAura(SPELL_SUMMON_GUARDIAN_OF_YS)))) cloud = summon; } diff --git a/src/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/scripts/Northrend/VioletHold/boss_erekem.cpp index e5a31ff36..cea1eb93b 100644 --- a/src/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -125,7 +125,8 @@ public: Creature *pGuard1 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_1_GUID)); Creature *pGuard2 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_2_GUID)); - if (pGuard1 && !pGuard1->IsAlive() || pGuard2 && !pGuard2->IsAlive()) + if ((pGuard1 && !pGuard1->IsAlive()) || + (pGuard2 && !pGuard2->IsAlive())) { events.RepeatEvent(urand(3000,6000)); break; diff --git a/src/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/scripts/Northrend/VioletHold/instance_violet_hold.cpp index f843f56ca..016201343 100644 --- a/src/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -397,7 +397,8 @@ public: pBoss->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); pBoss->SetReactState(REACT_AGGRESSIVE); - if (WaveCount == 6 && m_auiEncounter[0] == DONE || WaveCount == 12 && m_auiEncounter[1] == DONE) + if ((WaveCount == 6 && m_auiEncounter[0] == DONE) || + (WaveCount == 12 && m_auiEncounter[1] == DONE)) pBoss->SetLootMode(0); } }