diff options
author | Spp <none@none> | 2010-04-08 08:20:08 +0200 |
---|---|---|
committer | Spp <none@none> | 2010-04-08 08:20:08 +0200 |
commit | 4635fbc0201846721287a1eb730491262237babd (patch) | |
tree | 5b02b41f0099fd9d3af7f3a826ef0ca6dfe80748 | |
parent | 46f0674e237dd8fe97ba4f0769e18b4adfce841b (diff) |
Code Style (game + scripts only):
"!=" --> " != " (when needed)
" !=" --> " !="
"!= " --> "!= "
--HG--
branch : trunk
54 files changed, 270 insertions, 270 deletions
diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index ea40945ac08..ea1d73b67ee 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -268,7 +268,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un case ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE: return true; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE: - if (!target || target->GetTypeId()!=TYPEID_UNIT) + if (!target || target->GetTypeId() != TYPEID_UNIT) return false; return target->GetEntry() == creature.id; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE: @@ -380,14 +380,14 @@ AchievementMgr::~AchievementMgr() void AchievementMgr::Reset() { - for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter) + for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { WorldPacket data(SMSG_ACHIEVEMENT_DELETED,4); data << uint32(iter->first); m_player->SendDirectMessage(&data); } - for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter) + for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) { WorldPacket data(SMSG_CRITERIA_DELETED,4); data << uint32(iter->first); @@ -411,7 +411,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin return; AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type); - for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i) + for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { AchievementCriteriaEntry const *achievementCriteria = (*i); @@ -457,7 +457,7 @@ void AchievementMgr::SaveToDB() bool need_execute = false; std::ostringstream ssdel; std::ostringstream ssins; - for (CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter) + for (CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { if (!iter->second.changed) continue; @@ -501,7 +501,7 @@ void AchievementMgr::SaveToDB() bool need_execute_ins = false; std::ostringstream ssdel; std::ostringstream ssins; - for (CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter) + for (CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) { if (!iter->second.changed) continue; @@ -708,7 +708,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui return; AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type); - for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i) + for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { AchievementCriteriaEntry const *achievementCriteria = (*i); @@ -860,7 +860,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT: { uint32 counter =0; - for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); itr++) + for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr != GetPlayer()->getQuestStatusMap().end(); itr++) if (itr->second.m_rewarded) counter++; SetCriteriaProgress(achievementCriteria, counter); @@ -873,7 +873,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; uint32 counter =0; - for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); itr++) + for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr != GetPlayer()->getQuestStatusMap().end(); itr++) { Quest const* quest = objmgr.GetQuestTemplate(itr->first); if (itr->second.m_rewarded && quest && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID) @@ -1086,7 +1086,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui break; } case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL: - if (miscvalue1 && miscvalue1!=achievementCriteria->learn_spell.spellID) + if (miscvalue1 && miscvalue1 != achievementCriteria->learn_spell.spellID) continue; if (GetPlayer()->HasSpell(achievementCriteria->learn_spell.spellID)) @@ -1901,14 +1901,14 @@ void AchievementMgr::SendRespondInspectAchievements(Player* player) */ void AchievementMgr::BuildAllDataPacket(WorldPacket *data) { - for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter) + for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { *data << uint32(iter->first); *data << uint32(secsToTimeBitFields(iter->second.date)); } *data << int32(-1); - for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter) + for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) { *data << uint32(iter->first); data->appendPackGUID(iter->second.counter); @@ -2087,7 +2087,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: // any cases break; case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: // need skip generic cases - if (criteria->win_rated_arena.flag!=ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE) + if (criteria->win_rated_arena.flag != ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE) continue; break; case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: // any cases @@ -2103,7 +2103,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2: // any cases break; case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: // need skip generic cases - if (criteria->loot_type.lootTypeCount!=1) + if (criteria->loot_type.lootTypeCount != 1) continue; break; default: // type not use DB data, ignore diff --git a/src/game/AchievementMgr.h b/src/game/AchievementMgr.h index 573e80b9534..1e810a5160d 100644 --- a/src/game/AchievementMgr.h +++ b/src/game/AchievementMgr.h @@ -286,19 +286,19 @@ class AchievementGlobalMgr AchievementReward const* GetAchievementReward(AchievementEntry const* achievement) const { AchievementRewards::const_iterator iter = m_achievementRewards.find(achievement->ID); - return iter!=m_achievementRewards.end() ? &iter->second : NULL; + return iter != m_achievementRewards.end() ? &iter->second : NULL; } AchievementRewardLocale const* GetAchievementRewardLocale(AchievementEntry const* achievement) const { AchievementRewardLocales::const_iterator iter = m_achievementRewardLocales.find(achievement->ID); - return iter!=m_achievementRewardLocales.end() ? &iter->second : NULL; + return iter != m_achievementRewardLocales.end() ? &iter->second : NULL; } AchievementCriteriaDataSet const* GetCriteriaDataSet(AchievementCriteriaEntry const *achievementCriteria) { AchievementCriteriaDataMap::const_iterator iter = m_criteriaDataMap.find(achievementCriteria->ID); - return iter!=m_criteriaDataMap.end() ? &iter->second : NULL; + return iter != m_criteriaDataMap.end() ? &iter->second : NULL; } bool IsRealmCompleted(AchievementEntry const* achievement) const diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index cf43ea249ba..6e538efd858 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -1835,7 +1835,7 @@ void BattleGround::HandleKillPlayer(Player *player, Player *killer) uint32 BattleGround::GetPlayerTeam(uint64 guid) { BattleGroundPlayerMap::const_iterator itr = m_Players.find(guid); - if (itr!=m_Players.end()) + if (itr != m_Players.end()) return itr->second.Team; return 0; } diff --git a/src/game/Cell.h b/src/game/Cell.h index 4b77a278ddf..49e0329ace6 100644 --- a/src/game/Cell.h +++ b/src/game/Cell.h @@ -147,7 +147,7 @@ struct Cell } bool operator == (const Cell &cell) const { return (data.All == cell.data.All); } - bool operator!=(const Cell &cell) const { return !operator == (cell); } + bool operator != (const Cell &cell) const { return !operator == (cell); } union { struct diff --git a/src/game/ChannelMgr.cpp b/src/game/ChannelMgr.cpp index 24da2b00215..f31d3ffde50 100644 --- a/src/game/ChannelMgr.cpp +++ b/src/game/ChannelMgr.cpp @@ -38,7 +38,7 @@ ChannelMgr* channelMgr(uint32 team) ChannelMgr::~ChannelMgr() { - for (ChannelMap::iterator itr = channels.begin(); itr!=channels.end(); ++itr) + for (ChannelMap::iterator itr = channels.begin(); itr != channels.end(); ++itr) delete itr->second; channels.clear(); diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index fc4539c7d72..f24cc41130a 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -982,7 +982,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co SetSentErrorMessage(false); // table[i].Name == "" is special case: send original command to handler - if ((this->*(table[i].Handler))(strlen(table[i].Name)!=0 ? text : oldtext)) + if ((this->*(table[i].Handler))(strlen(table[i].Name) != 0 ? text : oldtext)) { if (table[i].SecurityLevel > SEC_PLAYER) { @@ -1318,7 +1318,7 @@ valid examples: { propertyId = 0; negativeNumber = false; - while ((c = reader.get())!=':') + while ((c = reader.get()) != ':') { if (c >='0' && c <= '9') { @@ -1378,7 +1378,7 @@ valid examples: } c = reader.peek(); // level - while (c !='|' && c!='\0') + while (c !='|' && c != '\0') { reader.ignore(1); c = reader.peek(); @@ -1397,7 +1397,7 @@ valid examples: char c = reader.peek(); // base64 encoded stuff - while (c !='|' && c!='\0') + while (c !='|' && c != '\0') { reader.ignore(1); c = reader.peek(); @@ -1421,7 +1421,7 @@ valid examples: char c = reader.peek(); // skillpoints? whatever, drop it - while (c !='|' && c!='\0') + while (c !='|' && c != '\0') { reader.ignore(1); c = reader.peek(); @@ -1478,7 +1478,7 @@ valid examples: char c = reader.peek(); // skip progress - while (c !='|' && c!='\0') + while (c !='|' && c != '\0') { reader.ignore(1); c = reader.peek(); @@ -1934,7 +1934,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s return NULL; // return non link case - if (text[0]!='|') + if (text[0] != '|') return strtok(text, " "); // [name] Shift-click form |color|linkType:key|h[name]|h|r @@ -1982,7 +1982,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes, return NULL; // return non link case - if (text[0]!='|') + if (text[0] != '|') return strtok(text, " "); // [name] Shift-click form |color|linkType:key|h[name]|h|r diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 1f7af300bd5..66400709036 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -241,7 +241,7 @@ void Creature::SearchFormation() void Creature::RemoveCorpse() { - if ((getDeathState()!=CORPSE && !m_isDeadByDefault) || (getDeathState()!=ALIVE && m_isDeadByDefault)) + if ((getDeathState() != CORPSE && !m_isDeadByDefault) || (getDeathState() != ALIVE && m_isDeadByDefault)) return; m_deathTimer = 0; @@ -828,7 +828,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const switch(GetCreatureInfo()->trainer_type) { case TRAINER_TYPE_CLASS: - if (pPlayer->getClass()!=GetCreatureInfo()->trainer_class) + if (pPlayer->getClass() != GetCreatureInfo()->trainer_class) { if (msg) { @@ -850,7 +850,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const } break; case TRAINER_TYPE_PETS: - if (pPlayer->getClass()!=CLASS_HUNTER) + if (pPlayer->getClass() != CLASS_HUNTER) { pPlayer->PlayerTalkClass->ClearMenus(); pPlayer->PlayerTalkClass->SendGossipMenu(3620,GetGUID()); diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index d4c01145f2b..ef6f556ca99 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -263,7 +263,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction case EVENT_T_SUMMONED_UNIT: { //Prevent event from occuring on no unit or non creatures - if (!pActionInvoker || pActionInvoker->GetTypeId()!=TYPEID_UNIT) + if (!pActionInvoker || pActionInvoker->GetTypeId() != TYPEID_UNIT) return false; //Creature id doesn't match up @@ -567,7 +567,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 break; case ACTION_T_COMBAT_MOVEMENT: // ignore no affect case - if (CombatMovementEnabled == (action.combat_movement.state!=0)) + if (CombatMovementEnabled == (action.combat_movement.state != 0)) return; CombatMovementEnabled = action.combat_movement.state != 0; diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index 68aae64e77d..a66fc887ce3 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -477,7 +477,7 @@ void LoadDBCStores(const std::string& dataPath) continue; TaxiPathSetBySource::const_iterator src_i = sTaxiPathSetBySource.find(i); - if (src_i!=sTaxiPathSetBySource.end() && !src_i->second.empty()) + if (src_i != sTaxiPathSetBySource.end() && !src_i->second.empty()) { bool ok = false; for (TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin(); dest_i != src_i->second.end(); ++dest_i) @@ -690,7 +690,7 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT if (!reqEntry) return false; - if (itemEntry->categoryType!=reqEntry->categoryType) + if (itemEntry->categoryType != reqEntry->categoryType) return false; return (itemEntry->categoryMask & reqEntry->categoryMask) == reqEntry->categoryMask; diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 78867d593e3..6105a86bdcc 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -871,7 +871,7 @@ struct FactionTemplateEntry return false; return hostileMask == 0 && friendlyMask == 0; } - bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD)!=0; } + bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; } }; struct GameObjectDisplayInfoEntry diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp index 02ebbc329b4..ee8c623c3d0 100644 --- a/src/game/Debugcmds.cpp +++ b/src/game/Debugcmds.cpp @@ -49,7 +49,7 @@ bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args) return false; uint8 failnum = (uint8)atoi(px); - if (failnum == 0 && *px!='0') + if (failnum == 0 && *px != '0') return false; char* p1 = strtok(NULL, " "); diff --git a/src/game/GridDefines.h b/src/game/GridDefines.h index 9637881836e..5269d0a094d 100644 --- a/src/game/GridDefines.h +++ b/src/game/GridDefines.h @@ -79,7 +79,7 @@ struct CoordPair CoordPair(uint32 x=0, uint32 y=0) : x_coord(x), y_coord(y) {} CoordPair(const CoordPair<LIMIT> &obj) : x_coord(obj.x_coord), y_coord(obj.y_coord) {} bool operator == (const CoordPair<LIMIT> &obj) const { return (obj.x_coord == x_coord && obj.y_coord == y_coord); } - bool operator!=(const CoordPair<LIMIT> &obj) const { return !operator == (obj); } + bool operator != (const CoordPair<LIMIT> &obj) const { return !operator == (obj); } CoordPair<LIMIT>& operator=(const CoordPair<LIMIT> &obj) { x_coord = obj.x_coord; diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp index e481e457a3f..b10dfa8791e 100644 --- a/src/game/GridNotifiers.cpp +++ b/src/game/GridNotifiers.cpp @@ -37,7 +37,7 @@ VisibleNotifier::SendToSelf() // at this moment i_clientGUIDs have guids that not iterate at grid level checks // but exist one case when this possible and object not out of range: transports if (Transport* transport = i_player.GetTransport()) - for (Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin();itr!=transport->GetPassengers().end();++itr) + for (Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin();itr != transport->GetPassengers().end();++itr) { if (vis_guids.find((*itr)->GetGUID()) != vis_guids.end()) { diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index 1c806678d5f..9143f14d0dd 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -515,7 +515,7 @@ namespace Trinity ExplodeCorpseObjectCheck(Unit* funit, float range) : i_funit(funit), i_range(range) {} bool operator()(Player* u) { - if (u->getDeathState()!=CORPSE || u->isInFlight() || + if (u->getDeathState() != CORPSE || u->isInFlight() || u->HasAuraType(SPELL_AURA_GHOST) || (u->GetDisplayId() != u->GetNativeDisplayId())) return false; @@ -523,9 +523,9 @@ namespace Trinity } bool operator()(Creature* u) { - if (u->getDeathState()!=CORPSE || u->isInFlight() || u->isDeadByDefault() || + if (u->getDeathState() != CORPSE || u->isInFlight() || u->isDeadByDefault() || (u->GetDisplayId() != u->GetNativeDisplayId()) || - (u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL)!=0) + (u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL) != 0) return false; return i_funit->IsWithinDistInMap(u, i_range); diff --git a/src/game/Group.cpp b/src/game/Group.cpp index d4dc05a9b78..c06833354e6 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -258,7 +258,7 @@ uint32 Group::RemoveInvite(Player *player) void Group::RemoveAllInvites() { - for (InvitesList::iterator itr=m_invitees.begin(); itr!=m_invitees.end(); ++itr) + for (InvitesList::iterator itr=m_invitees.begin(); itr != m_invitees.end(); ++itr) (*itr)->SetGroupInvite(NULL); m_invitees.clear(); @@ -482,7 +482,7 @@ void Group::SendLootStartRoll(uint32 CountDown, const Roll &r) data << uint32(CountDown); // the countdown time to choose "need" or "greed" data << uint8(ALL_ROLL_TYPE_MASK); // roll type mask - for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr) + for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) { Player *p = objmgr.GetPlayer(itr->first); if (!p || !p->GetSession()) @@ -506,7 +506,7 @@ void Group::SendLootRoll(const uint64& SourceGuid, const uint64& TargetGuid, uin data << uint8(RollType); // 0: "Need for: [item name]" 0: "You have selected need for [item name] 1: need roll 2: greed roll data << uint8(0); // 2.4.0 - for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr) + for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) { Player *p = objmgr.GetPlayer(itr->first); if (!p || !p->GetSession()) @@ -529,7 +529,7 @@ void Group::SendLootRollWon(const uint64& SourceGuid, const uint64& TargetGuid, data << uint8(RollNumber); // rollnumber realted to SMSG_LOOT_ROLL data << uint8(RollType); // Rolltype related to SMSG_LOOT_ROLL - for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr) + for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) { Player *p = objmgr.GetPlayer(itr->first); if (!p || !p->GetSession()) @@ -549,7 +549,7 @@ void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r) data << uint32(r.itemRandomPropId); // Item random property ID data << uint32(r.itemRandomSuffix); // Item random suffix ID - for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr) + for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) { Player *p = objmgr.GetPlayer(itr->first); if (!p || !p->GetSession()) @@ -819,7 +819,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers) uint64 maxguid = (*roll->playerVote.begin()).first; Player *player; - for (Roll::PlayerVote::const_iterator itr=roll->playerVote.begin(); itr!=roll->playerVote.end(); ++itr) + for (Roll::PlayerVote::const_iterator itr=roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr) { if (itr->second != NEED) continue; @@ -1584,7 +1584,7 @@ bool Group::InCombatToInstance(uint32 instanceId) { Player *pPlayer = itr->getSource(); if (pPlayer && pPlayer->getAttackers().size() && pPlayer->GetInstanceId() == instanceId && (pPlayer->GetMap()->IsRaidOrHeroicDungeon())) - for (std::set<Unit*>::const_iterator i = pPlayer->getAttackers().begin(); i!=pPlayer->getAttackers().end(); ++i) + for (std::set<Unit*>::const_iterator i = pPlayer->getAttackers().begin(); i != pPlayer->getAttackers().end(); ++i) if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) return true; } diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp index 05e490684bd..1d6aae6f095 100644 --- a/src/game/GroupHandler.cpp +++ b/src/game/GroupHandler.cpp @@ -915,11 +915,11 @@ void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recv_data) // ignore if player not loaded if (!GetPlayer()) // needed because STATUS_AUTHED { - if (unkn!=0) + if (unkn != 0) sLog.outError("CMSG_GROUP_PASS_ON_LOOT value<>0 for not-loaded character!"); return; } - if (unkn!=0) + if (unkn != 0) sLog.outError("CMSG_GROUP_PASS_ON_LOOT: activation not implemented!"); } diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 2d940bfbaf8..c3ca61c123c 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -515,7 +515,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) if (pItem) { // prevent sell not owner item - if (_player->GetGUID()!=pItem->GetOwnerGUID()) + if (_player->GetGUID() != pItem->GetOwnerGUID()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0); return; @@ -1172,7 +1172,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) return; // not first not-colored (not normaly used) socket - if (i!=0 && !itemProto->Socket[i-1].Color && (i+1 >= MAX_GEM_SOCKETS || itemProto->Socket[i+1].Color)) + if (i != 0 && !itemProto->Socket[i-1].Color && (i+1 >= MAX_GEM_SOCKETS || itemProto->Socket[i+1].Color)) return; // ok, this is first not colored socket for item with prismatic socket diff --git a/src/game/LFGHandler.cpp b/src/game/LFGHandler.cpp index abcf54161ec..f7323ffad64 100644 --- a/src/game/LFGHandler.cpp +++ b/src/game/LFGHandler.cpp @@ -47,7 +47,7 @@ static void AttemptJoin(Player* _player) continue; // skip not auto add, not group leader cases - if (!plr->GetSession()->LookingForGroup_auto_add || plr->GetGroup() && plr->GetGroup()->GetLeaderGUID()!=plr->GetGUID()) + if (!plr->GetSession()->LookingForGroup_auto_add || plr->GetGroup() && plr->GetGroup()->GetLeaderGUID() != plr->GetGUID()) continue; // skip non auto-join or empty slots, or non compatible slots @@ -86,7 +86,7 @@ static void AttemptJoin(Player* _player) static void AttemptAddMore(Player* _player) { // skip not group leader case - if (_player->GetGroup() && _player->GetGroup()->GetLeaderGUID()!=_player->GetGUID()) + if (_player->GetGroup() && _player->GetGroup()->GetLeaderGUID() != _player->GetGUID()) return; if (!_player->m_lookingForGroup.more.canAutoJoin()) diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index 5f8198e5a87..5873a72ca83 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -2835,7 +2835,7 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args) float y = (float)atof(py); // prevent accept wrong numeric args - if ((x == 0.0f && *px!='0') || (y == 0.0f && *py!='0')) + if ((x == 0.0f && *px != '0') || (y == 0.0f && *py != '0')) return false; uint32 areaid = cAreaId ? (uint32)atoi(cAreaId) : _player->GetZoneId(); diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 3d2b3248938..3fb48cc3de9 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -1310,7 +1310,7 @@ bool ChatHandler::HandleNpcMoveCommand(const char* args) uint32 map_id = data->mapid; - if (m_session->GetPlayer()->GetMapId()!=map_id) + if (m_session->GetPlayer()->GetMapId() != map_id) { PSendSysMessage(LANG_COMMAND_CREATUREATSAMEMAP, lowguid); SetSentErrorMessage(true); @@ -1670,7 +1670,7 @@ bool ChatHandler::HandleNpcUnFollowCommand(const char* /*args*/) } if (/*creature->GetMotionMaster()->empty() ||*/ - creature->GetMotionMaster()->GetCurrentMovementGeneratorType ()!=TARGETED_MOTION_TYPE) + creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != TARGETED_MOTION_TYPE) { PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU); SetSentErrorMessage(true); @@ -1680,7 +1680,7 @@ bool ChatHandler::HandleNpcUnFollowCommand(const char* /*args*/) TargetedMovementGenerator<Creature> const* mgen = static_cast<TargetedMovementGenerator<Creature> const*>((creature->GetMotionMaster()->top())); - if (mgen->GetTarget()!=player) + if (mgen->GetTarget() != player) { PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU); SetSentErrorMessage(true); @@ -1836,7 +1836,7 @@ bool ChatHandler::HandleNpcNameCommand(const char* /*args*/) for (uint8 i = 0; i < strlen(args); ++i) { - if (!isalpha(args[i]) && args[i]!=' ') + if (!isalpha(args[i]) && args[i] != ' ') { SendSysMessage(LANG_CHARS_ONLY); return false; @@ -1885,7 +1885,7 @@ bool ChatHandler::HandleNpcSubNameCommand(const char* /*args*/) for (uint8 i = 0; i < strlen(args); i++) { - if (!isalpha(args[i]) && args[i]!=' ') + if (!isalpha(args[i]) && args[i] != ' ') { SendSysMessage(LANG_CHARS_ONLY); return false; diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 33f1533c1d9..3b14b9d9ac2 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -1142,12 +1142,12 @@ bool ChatHandler::HandleReloadGameObjectScriptsCommand(const char* arg) return false; } - if (*arg!='a') + if (*arg != 'a') sLog.outString("Re-Loading Scripts from `gameobject_scripts`..."); objmgr.LoadGameObjectScripts(); - if (*arg!='a') + if (*arg != 'a') SendGlobalGMSysMessage("DB table `gameobject_scripts` reloaded."); return true; @@ -1162,12 +1162,12 @@ bool ChatHandler::HandleReloadEventScriptsCommand(const char* arg) return false; } - if (*arg!='a') + if (*arg != 'a') sLog.outString("Re-Loading Scripts from `event_scripts`..."); objmgr.LoadEventScripts(); - if (*arg!='a') + if (*arg != 'a') SendGlobalGMSysMessage("DB table `event_scripts` reloaded."); return true; @@ -1182,12 +1182,12 @@ bool ChatHandler::HandleReloadWpScriptsCommand(const char* arg) return false; } - if (*arg!='a') + if (*arg != 'a') sLog.outString("Re-Loading Scripts from `waypoint_scripts`..."); objmgr.LoadWaypointScripts(); - if (*arg!='a') + if (*arg != 'a') SendGlobalGMSysMessage("DB table `waypoint_scripts` reloaded."); return true; @@ -1227,12 +1227,12 @@ bool ChatHandler::HandleReloadQuestEndScriptsCommand(const char* arg) return false; } - if (*arg!='a') + if (*arg != 'a') sLog.outString("Re-Loading Scripts from `quest_end_scripts`..."); objmgr.LoadQuestEndScripts(); - if (*arg!='a') + if (*arg != 'a') SendGlobalGMSysMessage("DB table `quest_end_scripts` reloaded."); return true; @@ -1247,12 +1247,12 @@ bool ChatHandler::HandleReloadQuestStartScriptsCommand(const char* arg) return false; } - if (*arg!='a') + if (*arg != 'a') sLog.outString("Re-Loading Scripts from `quest_start_scripts`..."); objmgr.LoadQuestStartScripts(); - if (*arg!='a') + if (*arg != 'a') SendGlobalGMSysMessage("DB table `quest_start_scripts` reloaded."); return true; @@ -1267,12 +1267,12 @@ bool ChatHandler::HandleReloadSpellScriptsCommand(const char* arg) return false; } - if (*arg!='a') + if (*arg != 'a') sLog.outString("Re-Loading Scripts from `spell_scripts`..."); objmgr.LoadSpellScripts(); - if (*arg!='a') + if (*arg != 'a') SendGlobalGMSysMessage("DB table `spell_scripts` reloaded."); return true; @@ -2521,7 +2521,7 @@ bool ChatHandler::HandleLearnAllMyPetTalentsCommand(const char* /*args*/) for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { - if (talentInfo->RankID[rank]!=0) + if (talentInfo->RankID[rank] != 0) { spellid = talentInfo->RankID[rank]; break; @@ -2712,7 +2712,7 @@ bool ChatHandler::HandleAddItemCommand(const char *args) if (count > 0 && item) { pl->SendNewItem(item,count,false,true); - if (pl!=plTarget) + if (pl != plTarget) plTarget->SendNewItem(item,count,true,false); } @@ -2769,7 +2769,7 @@ bool ChatHandler::HandleAddItemSetCommand(const char *args) item->SetBinding(false); pl->SendNewItem(item,1,false,true); - if (pl!=plTarget) + if (pl != plTarget) plTarget->SendNewItem(item,1,true,false); } else @@ -3813,7 +3813,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args) else ss << id << " - " << name << " " << localeNames[loc]; - if (repState) // and then target!=NULL also + if (repState) // and then target != NULL also { ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]); @@ -4034,10 +4034,10 @@ bool ChatHandler::HandleGuildCreateCommand(const char *args) // if not guild name only (in "") then player name Player* target; - if (!extractPlayerTarget(*args!='"' ? (char*)args : NULL, &target)) + if (!extractPlayerTarget(*args != '"' ? (char*)args : NULL, &target)) return false; - char* tailStr = *args!='"' ? strtok(NULL, "") : (char*)args; + char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args; if (!tailStr) return false; @@ -4073,10 +4073,10 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args) // if not guild name only (in "") then player name uint64 target_guid; - if (!extractPlayerTarget(*args!='"' ? (char*)args : NULL, NULL, &target_guid)) + if (!extractPlayerTarget(*args != '"' ? (char*)args : NULL, NULL, &target_guid)) return false; - char* tailStr = *args!='"' ? strtok(NULL, "") : (char*)args; + char* tailStr = *args != '"' ? strtok(NULL, "") : (char*)args; if (!tailStr) return false; @@ -5290,7 +5290,7 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args) owner->ToPlayer()->SendTalentsInfoData(true); ChatHandler(owner->ToPlayer()).SendSysMessage(LANG_RESET_PET_TALENTS); - if (!m_session || m_session->GetPlayer()!=owner->ToPlayer()) + if (!m_session || m_session->GetPlayer() != owner->ToPlayer()) PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE,GetNameLink(owner->ToPlayer()).c_str()); } return true; @@ -5306,7 +5306,7 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args) target->resetTalents(true); target->SendTalentsInfoData(false); ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS); - if (!m_session || m_session->GetPlayer()!=target) + if (!m_session || m_session->GetPlayer() != target) PSendSysMessage(LANG_RESET_TALENTS_ONLINE,GetNameLink(target).c_str()); Pet* pet = target->GetPet(); @@ -5387,7 +5387,7 @@ bool ChatHandler::HandleServerShutDownCommand(const char *args) int32 time = atoi (time_str); ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0]!='0' || time_str[1]!='\0')) || time < 0) + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0) return false; if (exitcode_str) @@ -5422,7 +5422,7 @@ bool ChatHandler::HandleServerRestartCommand(const char *args) int32 time = atoi (time_str); ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0]!='0' || time_str[1]!='\0') || time < 0)) + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0') || time < 0)) return false; if (exitcode_str) @@ -5457,7 +5457,7 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char *args) int32 time = atoi (time_str); ///- Prevent interpret wrong arg value as 0 secs shutdown time - if ((time == 0 && (time_str[0]!='0' || time_str[1]!='\0') || time < 0)) + if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0') || time < 0)) return false; if (exitcode_str) @@ -5492,7 +5492,7 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char *args) int32 time = atoi (time_str); ///- Prevent interpret wrong arg value as 0 secs shutdown time - if (time == 0 && (time_str[0]!='0' || time_str[1]!='\0') || time < 0) + if (time == 0 && (time_str[0] != '0' || time_str[1] != '\0') || time < 0) return false; if (exitcode_str) @@ -6176,7 +6176,7 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/) Unit* target = getSelectedUnit(); if (pl->GetSelection() && target) { - if (target->GetTypeId()!=TYPEID_UNIT || target->isPet()) + if (target->GetTypeId() != TYPEID_UNIT || target->isPet()) { SendSysMessage(LANG_SELECT_CREATURE); SetSentErrorMessage(true); diff --git a/src/game/Map.cpp b/src/game/Map.cpp index d74a8d1d664..f6993e29cfb 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -92,7 +92,7 @@ bool Map::ExistMap(uint32 mapid,int gx,int gy) map_fileheader header; fread(&header, sizeof(header), 1, pf); - if (header.mapMagic != uint32(MAP_MAGIC) || + if (header.mapMagic != uint32(MAP_MAGIC) || header.versionMagic != uint32(MAP_VERSION_MAGIC)) { sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.",tmp); @@ -2122,9 +2122,9 @@ void Map::SendInitSelf(Player * player) // build other passengers at transport also (they always visible and marked as visible and will not send at visibility update at add to map if (Transport* transport = player->GetTransport()) { - for (Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin(); itr!=transport->GetPassengers().end(); ++itr) + for (Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin(); itr != transport->GetPassengers().end(); ++itr) { - if (player!=(*itr) && player->HaveAtClient(*itr)) + if (player != (*itr) && player->HaveAtClient(*itr)) { (*itr)->BuildCreateUpdateBlockForPlayer(&data, player); } @@ -2178,7 +2178,7 @@ void Map::SendRemoveTransports(Player * player) // except used transport for (MapManager::TransportSet::const_iterator i = tset.begin(); i != tset.end(); ++i) - if ((*i) != player->GetTransport() && (*i)->GetMapId()!=GetId()) + if ((*i) != player->GetTransport() && (*i)->GetMapId() != GetId()) (*i)->BuildOutOfRangeUpdateBlock(&transData); WorldPacket packet; @@ -3009,7 +3009,7 @@ void Map::ScriptsProcess() break; } - if (source->GetTypeId()!=TYPEID_UNIT) + if (source->GetTypeId() != TYPEID_UNIT) { sLog.outError("SCRIPT_COMMAND_TALK call for non-creature (TypeId: %u, Entry: %u, GUID: %u), skipping.",source->GetTypeId(),source->GetEntry(),source->GetGUIDLow()); break; @@ -3058,7 +3058,7 @@ void Map::ScriptsProcess() break; } - if (source->GetTypeId()!=TYPEID_UNIT) + if (source->GetTypeId() != TYPEID_UNIT) { sLog.outError("SCRIPT_COMMAND_EMOTE call for non-creature (TypeId: %u, Entry: %u, GUID: %u), skipping.",source->GetTypeId(),source->GetEntry(),source->GetGUIDLow()); break; @@ -3091,7 +3091,7 @@ void Map::ScriptsProcess() break; } - if (source->GetTypeId()!=TYPEID_UNIT) + if (source->GetTypeId() != TYPEID_UNIT) { sLog.outError("SCRIPT_COMMAND_MOVE_TO call for non-creature (TypeId: %u, Entry: %u, GUID: %u), skipping.",source->GetTypeId(),source->GetEntry(),source->GetGUIDLow()); break; @@ -3409,7 +3409,7 @@ void Map::ScriptsProcess() if (target->GetTypeId() == TYPEID_PLAYER) { - if (source->GetTypeId()!=TYPEID_UNIT && source->GetTypeId()!=TYPEID_GAMEOBJECT) + if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT) { sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED call for non-creature and non-gameobject (TypeId: %u, Entry: %u, GUID: %u), skipping.",source->GetTypeId(),source->GetEntry(),source->GetGUIDLow()); break; @@ -3420,7 +3420,7 @@ void Map::ScriptsProcess() } else { - if (target->GetTypeId()!=TYPEID_UNIT && target->GetTypeId()!=TYPEID_GAMEOBJECT) + if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT) { sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED call for non-creature and non-gameobject (TypeId: %u, Entry: %u, GUID: %u), skipping.",target->GetTypeId(),target->GetEntry(),target->GetGUIDLow()); break; @@ -3437,7 +3437,7 @@ void Map::ScriptsProcess() } // quest id and flags checked at script loading - if ((worldObject->GetTypeId()!=TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) && + if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) && (step.script->datalong2 == 0 || worldObject->IsWithinDistInMap(player,float(step.script->datalong2)))) player->AreaExploredOrEventHappens(step.script->datalong); else @@ -3466,7 +3466,7 @@ void Map::ScriptsProcess() break; } - if (target->GetTypeId()!=TYPEID_GAMEOBJECT) + if (target->GetTypeId() != TYPEID_GAMEOBJECT) { sLog.outError("SCRIPT_COMMAND_ACTIVATE_OBJECT call for non-gameobject (TypeId: %u, Entry: %u, GUID: %u), skipping.",target->GetTypeId(),target->GetEntry(),target->GetGUIDLow()); break; diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 5ebc08b389a..1e8e0e7ea3b 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -808,7 +808,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) return; } - if (GetPlayer()->GetMapId()!=atEntry->mapid) + if (GetPlayer()->GetMapId() != atEntry->mapid) { sLog.outDebug("Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", GetPlayer()->GetName(), atEntry->mapid, GetPlayer()->GetMapId(), GetPlayer()->GetGUIDLow(), Trigger_ID); return; @@ -1153,7 +1153,7 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data) if (!GetPlayer()) // ignore until not logged (check needed because STATUS_AUTHED) { - if (ActionBar!=0) + if (ActionBar != 0) sLog.outError("WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored",uint32(ActionBar)); return; } diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp index bd9e704ef62..6019d545717 100644 --- a/src/game/NPCHandler.cpp +++ b/src/game/NPCHandler.cpp @@ -603,7 +603,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data) Pet *pet = _player->GetPet(); // can't place in stable dead pet - if (!pet||!pet->isAlive()||pet->getPetType()!=HUNTER_PET) + if (!pet||!pet->isAlive()||pet->getPetType() != HUNTER_PET) { WorldPacket data(SMSG_STABLE_RESULT, 1); data << uint8(0x06); @@ -624,7 +624,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data) uint32 slot = fields[1].GetUInt32(); // slots ordered in query, and if not equal then free - if (slot!=free_slot) + if (slot != free_slot) break; // this slot not free, skip @@ -787,7 +787,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data) Pet* pet = _player->GetPet(); - if (!pet || pet->getPetType()!=HUNTER_PET) + if (!pet || pet->getPetType() != HUNTER_PET) return; // find swapped pet slot in stable diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 5e60d8a8011..45cb0ead510 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1821,7 +1821,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy { // Remove Demonic Sacrifice auras (known pet) Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr!=auraClassScripts.end();) + for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();) { if ((*itr)->GetMiscValue() == 2228) { @@ -1902,7 +1902,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy { // Remove Demonic Sacrifice auras (known pet) Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr!=auraClassScripts.end();) + for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();) { if ((*itr)->GetMiscValue() == 2228) { diff --git a/src/game/ObjectDefines.h b/src/game/ObjectDefines.h index 2fe9757cc50..8247b3378c7 100644 --- a/src/game/ObjectDefines.h +++ b/src/game/ObjectDefines.h @@ -55,7 +55,7 @@ enum HighGuid #define IS_VEHICLE_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_VEHICLE) #define IS_CRE_OR_VEH_GUID(Guid) (IS_CREATURE_GUID(Guid) || IS_VEHICLE_GUID(Guid)) #define IS_CRE_OR_VEH_OR_PET_GUID(Guid)(IS_CRE_OR_VEH_GUID(Guid) || IS_PET_GUID(Guid)) -#define IS_PLAYER_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_PLAYER && Guid!=0) +#define IS_PLAYER_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_PLAYER && Guid != 0) #define IS_UNIT_GUID(Guid) (IS_CRE_OR_VEH_OR_PET_GUID(Guid) || IS_PLAYER_GUID(Guid)) // special case for empty guid need check #define IS_ITEM_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_ITEM) diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index f673501145d..38555a2cb44 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -799,7 +799,7 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* { uint32 currSpellId = 0; bool spell = true; - while (p[0]!=0) + while (p[0] != 0) { ++p; if (p[0] == ' ' || p[0] == 0) @@ -845,7 +845,7 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* const_cast<CreatureDataAddonAura*&>(addon->auras) = new CreatureDataAddonAura[val.size()+1]; uint32 i=0; - for (std::map<uint32, uint32>::iterator itr = val.begin(); itr!=val.end();++itr) + for (std::map<uint32, uint32>::iterator itr = val.begin(); itr != val.end();++itr) { CreatureDataAddonAura& cAura = const_cast<CreatureDataAddonAura&>(addon->auras[i]); cAura.spell_id = itr->first; @@ -4086,7 +4086,7 @@ void ObjectMgr::LoadQuests() } - else if (qinfo->RewRepValue[j]!=0) + else if (qinfo->RewRepValue[j] != 0) { sLog.outErrorDb("Quest %u has `RewRepFaction%d` = 0 but `RewRepValue%d` = %i.", qinfo->GetQuestId(),j+1,j+1,qinfo->RewRepValue[j]); @@ -4550,7 +4550,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename) continue; } - if (info->type!=GAMEOBJECT_TYPE_DOOR) + if (info->type != GAMEOBJECT_TYPE_DOOR) { sLog.outErrorDb("Table `%s` has gameobject type (%u) non supported by command %s for script id %u",tablename,info->id,(tmp.command == SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id); continue; @@ -4862,7 +4862,7 @@ void ObjectMgr::LoadPageTexts() { std::ostringstream ss; ss << "The text page(s) "; - for (std::set<uint32>::iterator itr= checkedPages.begin(); itr!=checkedPages.end(); ++itr) + for (std::set<uint32>::iterator itr= checkedPages.begin(); itr != checkedPages.end(); ++itr) ss << *itr << " "; ss << "create(s) a circular reference, which can cause the server to freeze. Changing Next_Page of page " << pageItr->Page_ID <<" to 0"; @@ -5525,7 +5525,7 @@ void ObjectMgr::LoadGraveyardZones() continue; } - if (team!=0 && team!=HORDE && team!=ALLIANCE) + if (team != 0 && team != HORDE && team != ALLIANCE) { sLog.outErrorDb("Table `game_graveyard_zone` has record for non player faction (%u), skipped.",team); continue; @@ -6236,7 +6236,7 @@ inline void CheckGOLinkedTrapId(GameObjectInfo const* goInfo,uint32 dataN,uint32 { if (GameObjectInfo const* trapInfo = sGOStorage.LookupEntry<GameObjectInfo>(dataN)) { - if (trapInfo->type!=GAMEOBJECT_TYPE_TRAP) + if (trapInfo->type != GAMEOBJECT_TYPE_TRAP) sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.", goInfo->id,goInfo->type,N,dataN,dataN,GAMEOBJECT_TYPE_TRAP); } @@ -7686,7 +7686,7 @@ bool ObjectMgr::CheckDeclinedNames(std::wstring mainpart, DeclinedName const& na if (!Utf8toWStr(names.name[i],wname)) return false; - if (mainpart!=GetMainPartOfName(wname,i+1)) + if (mainpart != GetMainPartOfName(wname,i+1)) return false; } return true; @@ -7925,7 +7925,7 @@ SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial) { case SKILL_CATEGORY_LANGUAGES: return SKILL_RANGE_LANGUAGE; case SKILL_CATEGORY_WEAPON: - if (pSkill->id!=SKILL_FIST_WEAPONS) + if (pSkill->id != SKILL_FIST_WEAPONS) return SKILL_RANGE_LEVEL; else return SKILL_RANGE_MONO; @@ -8734,7 +8734,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (maxcount > 0 && incrtime == 0) { if (pl) - ChatHandler(pl).PSendSysMessage("MaxCount!=0 (%u) but IncrTime == 0", maxcount); + ChatHandler(pl).PSendSysMessage("MaxCount != 0 (%u) but IncrTime == 0", maxcount); else sLog.outErrorDb("Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry); return false; diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index a020a7a28d7..32949eb4731 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1330,8 +1330,8 @@ enum Opcodes enum SessionStatus { STATUS_AUTHED = 0, ///< Player authenticated (_player == NULL, m_playerRecentlyLogout = false or will be reset before handler call, m_GUID have garbage) - STATUS_LOGGEDIN, ///< Player in game (_player!=NULL, m_GUID == _player->GetGUID(), inWorld()) - STATUS_TRANSFER, ///< Player transferring to another map (_player!=NULL, m_GUID == _player->GetGUID(), !inWorld()) + STATUS_LOGGEDIN, ///< Player in game (_player != NULL, m_GUID == _player->GetGUID(), inWorld()) + STATUS_TRANSFER, ///< Player transferring to another map (_player != NULL, m_GUID == _player->GetGUID(), !inWorld()) STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, ///< _player!= NULL or _player == NULL && m_playerRecentlyLogout, m_GUID store last _player guid) STATUS_NEVER ///< Opcode not accepted from client (deprecated or server side only) }; diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index a34b84f720c..3cab76b8d9f 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -1358,7 +1358,7 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel } } } - else if (spellmgr.GetSpellRank(spell_id)!=0) + else if (spellmgr.GetSpellRank(spell_id) != 0) { for (PetSpellMap::const_iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2) { diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 1e89c3204ff..34b5bde73b0 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -788,7 +788,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c } } - for (PlayerCreateInfoItems::const_iterator item_id_itr = info->item.begin(); item_id_itr!=info->item.end(); ++item_id_itr++) + for (PlayerCreateInfoItems::const_iterator item_id_itr = info->item.begin(); item_id_itr != info->item.end(); ++item_id_itr++) StoreNewItemInBestSlots(item_id_itr->item_id, item_id_itr->item_amount); // bags and main-hand weapon must equipped at this moment @@ -909,7 +909,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) WorldPacket data(SMSG_ENVIRONMENTALDAMAGELOG, (21)); data << uint64(GetGUID()); - data << uint8(type!=DAMAGE_FALL_TO_VOID ? type : DAMAGE_FALL); + data << uint8(type != DAMAGE_FALL_TO_VOID ? type : DAMAGE_FALL); data << uint32(damage); data << uint32(absorb); data << uint32(resist); @@ -1075,7 +1075,7 @@ void Player::HandleDrowning(uint32 time_diff) // Recheck timers flag m_MirrorTimerFlags&=~UNDERWATER_EXIST_TIMERS; for (uint8 i = 0; i< MAX_TIMERS; ++i) - if (m_MirrorTimer[i]!=DISABLED_MIRROR_TIMER) + if (m_MirrorTimer[i] != DISABLED_MIRROR_TIMER) { m_MirrorTimerFlags|=UNDERWATER_EXIST_TIMERS; break; @@ -2845,7 +2845,7 @@ void Player::SendInitialSpells() uint16 spellCooldowns = m_spellCooldowns.size(); data << uint16(spellCooldowns); - for (SpellCooldowns::const_iterator itr=m_spellCooldowns.begin(); itr!=m_spellCooldowns.end(); ++itr) + for (SpellCooldowns::const_iterator itr=m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr) { SpellEntry const *sEntry = sSpellStore.LookupEntry(itr->first); if (!sEntry) @@ -3321,7 +3321,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen // lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL ((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0)) { - switch(GetSkillRangeType(pSkill,_spell_idx->second->racemask!=0)) + switch(GetSkillRangeType(pSkill,_spell_idx->second->racemask != 0)) { case SKILL_RANGE_LANGUAGE: SetSkill(pSkill->id, 300, 300); @@ -3561,7 +3561,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) { // 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)) + (IsProfessionSkill(pSkill->id) || _spell_idx->second->racemask != 0)) continue; SetSkill(pSkill->id, 0, 0); @@ -4942,7 +4942,7 @@ void Player::UpdateLocalChannels(uint32 newZone) snprintf(new_channel_name_buf,100,ch->pattern[m_session->GetSessionDbcLocale()],current_zone_name.c_str()); Channel* new_channel = cMgr->GetJoinChannel(new_channel_name_buf,ch->ChannelID); - if ((*i)!=new_channel) + if ((*i) != new_channel) { new_channel->Join(GetGUID(),""); // will output Changed Channel: N. Name @@ -7289,15 +7289,15 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl void Player::_ApplyWeaponDependentAuraMods(Item *item,WeaponAttackType attackType,bool apply) { AuraEffectList const& auraCritList = GetAuraEffectsByType(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); - for (AuraEffectList::const_iterator itr = auraCritList.begin(); itr!=auraCritList.end(); ++itr) + for (AuraEffectList::const_iterator itr = auraCritList.begin(); itr != auraCritList.end(); ++itr) _ApplyWeaponDependentAuraCritMod(item,attackType,*itr,apply); AuraEffectList const& auraDamageFlatList = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE); - for (AuraEffectList::const_iterator itr = auraDamageFlatList.begin(); itr!=auraDamageFlatList.end(); ++itr) + for (AuraEffectList::const_iterator itr = auraDamageFlatList.begin(); itr != auraDamageFlatList.end(); ++itr) _ApplyWeaponDependentAuraDamageMod(item,attackType,*itr,apply); AuraEffectList const& auraDamagePCTList = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); - for (AuraEffectList::const_iterator itr = auraDamagePCTList.begin(); itr!=auraDamagePCTList.end(); ++itr) + for (AuraEffectList::const_iterator itr = auraDamagePCTList.begin(); itr != auraDamagePCTList.end(); ++itr) _ApplyWeaponDependentAuraDamageMod(item,attackType,*itr,apply); } @@ -7559,7 +7559,7 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 if (!pEnchant) continue; for (uint8 s = 0; s < 3; ++s) { - if (pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; SpellEnchantProcEntry const* entry = spellmgr.GetSpellEnchantProcEvent(enchant_id); @@ -7675,7 +7675,7 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c continue; for (uint8 s = 0; s < 3; ++s) { - if (pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_USE_SPELL) + if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL) continue; SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]); @@ -7821,7 +7821,7 @@ void Player::_ApplyAmmoBonuses() float currentAmmoDPS; ItemPrototype const *ammo_proto = objmgr.GetItemPrototype(ammo_id); - if (!ammo_proto || ammo_proto->Class!=ITEM_CLASS_PROJECTILE || !CheckAmmoCompatibility(ammo_proto)) + if (!ammo_proto || ammo_proto->Class != ITEM_CLASS_PROJECTILE || !CheckAmmoCompatibility(ammo_proto)) currentAmmoDPS = 0.0f; else currentAmmoDPS = (ammo_proto->Damage[0].DamageMin + ammo_proto->Damage[0].DamageMax) / 2; @@ -7846,7 +7846,7 @@ bool Player::CheckAmmoCompatibility(const ItemPrototype *ammo_proto) const return false; ItemPrototype const* weapon_proto = weapon->GetProto(); - if (!weapon_proto || weapon_proto->Class!=ITEM_CLASS_WEAPON) + if (!weapon_proto || weapon_proto->Class != ITEM_CLASS_WEAPON) return false; // check ammo ws. weapon compatibility @@ -7854,11 +7854,11 @@ bool Player::CheckAmmoCompatibility(const ItemPrototype *ammo_proto) const { case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_CROSSBOW: - if (ammo_proto->SubClass!=ITEM_SUBCLASS_ARROW) + if (ammo_proto->SubClass != ITEM_SUBCLASS_ARROW) return false; break; case ITEM_SUBCLASS_WEAPON_GUN: - if (ammo_proto->SubClass!=ITEM_SUBCLASS_BULLET) + if (ammo_proto->SubClass != ITEM_SUBCLASS_BULLET) return false; break; default: @@ -9658,7 +9658,7 @@ uint8 Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - if (pProto->ItemLimitCategory && pProto->Class!=ITEM_CLASS_GEM) // gem have equip check (maybe sort by bonding?) + if (pProto->ItemLimitCategory && pProto->Class != ITEM_CLASS_GEM) // gem have equip check (maybe sort by bonding?) { ItemLimitCategoryEntry const* limitEntry = sItemLimitCategoryStore.LookupEntry(pProto->ItemLimitCategory); if (!limitEntry) @@ -9813,7 +9813,7 @@ uint8 Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemPrototyp pItem2 = NULL; // if merge skip empty, if !merge skip non-empty - if ((pItem2!=NULL)!=merge) + if ((pItem2 != NULL) != merge) continue; if (pItem2) @@ -9870,7 +9870,7 @@ uint8 Player::_CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, I pItem2 = NULL; // if merge skip empty, if !merge skip non-empty - if ((pItem2!=NULL)!=merge) + if ((pItem2 != NULL) != merge) continue; if (pItem2) @@ -9933,7 +9933,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 // check count of items (skip for auto move for same player from bank) uint32 no_similar_count = 0; // can't store this amount similar items uint8 res = _CanTakeMoreSimilarItems(entry,count,pItem,&no_similar_count); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (count == no_similar_count) { @@ -9948,7 +9948,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 if (bag != NULL_BAG && slot != NULL_SLOT) { res = _CanStoreItem_InSpecificSlot(bag,slot,dest,pProto,count,swap,pItem); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -9977,7 +9977,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 if (bag == INVENTORY_SLOT_BAG_0) // inventory { res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,true,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -9995,7 +9995,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 } res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,true,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10016,10 +10016,10 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 { // we need check 2 time (specialized/non_specialized), use NULL_BAG to prevent skipping bag res = _CanStoreItem_InBag(bag,dest,pProto,count,true,false,pItem,NULL_BAG,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) res = _CanStoreItem_InBag(bag,dest,pProto,count,true,true,pItem,NULL_BAG,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10046,7 +10046,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 { uint32 keyringSize = GetMaxKeyringSize(); res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,KEYRING_SLOT_START+keyringSize,dest,pProto,count,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10064,7 +10064,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 } res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10084,7 +10084,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10103,7 +10103,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 } res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10123,10 +10123,10 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 else // equipped bag { res = _CanStoreItem_InBag(bag,dest,pProto,count,false,false,pItem,NULL_BAG,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) res = _CanStoreItem_InBag(bag,dest,pProto,count,false,true,pItem,NULL_BAG,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10151,7 +10151,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 if (pProto->Stackable != 1) { res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,true,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10169,7 +10169,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 } res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,true,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10191,7 +10191,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { res = _CanStoreItem_InBag(i,dest,pProto,count,true,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) continue; if (count == 0) @@ -10209,7 +10209,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { res = _CanStoreItem_InBag(i,dest,pProto,count,true,true,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) continue; if (count == 0) @@ -10231,7 +10231,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 { uint32 keyringSize = GetMaxKeyringSize(); res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,KEYRING_SLOT_START+keyringSize,dest,pProto,count,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10251,7 +10251,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10272,7 +10272,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { res = _CanStoreItem_InBag(i,dest,pProto,count,false,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) continue; if (count == 0) @@ -10289,7 +10289,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 // search free slot res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) { if (no_space_count) *no_space_count = count + no_similar_count; @@ -10309,7 +10309,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { res = _CanStoreItem_InBag(i,dest,pProto,count,false,true,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) continue; if (count == 0) @@ -10812,7 +10812,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI } res = _CanStoreItem_InSpecificSlot(bag,slot,dest,pProto,count,swap,pItem); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) return res; if (count == 0) @@ -10837,7 +10837,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI if (bag == INVENTORY_SLOT_BAG_0) { res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START,BANK_SLOT_ITEM_END,dest,pProto,count,true,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) return res; if (count == 0) @@ -10846,10 +10846,10 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI else { res = _CanStoreItem_InBag(bag,dest,pProto,count,true,false,pItem,NULL_BAG,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) res = _CanStoreItem_InBag(bag,dest,pProto,count,true,true,pItem,NULL_BAG,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) return res; if (count == 0) @@ -10861,7 +10861,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI if (bag == INVENTORY_SLOT_BAG_0) { res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START,BANK_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) return res; if (count == 0) @@ -10900,7 +10900,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { res = _CanStoreItem_InBag(i,dest,pProto,count,true,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) continue; if (count == 0) @@ -10911,7 +10911,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { res = _CanStoreItem_InBag(i,dest,pProto,count,true,true,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) continue; if (count == 0) @@ -10925,7 +10925,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { res = _CanStoreItem_InBag(i,dest,pProto,count,false,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) continue; if (count == 0) @@ -10935,7 +10935,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI // search free space res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START,BANK_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) return res; if (count == 0) @@ -10944,7 +10944,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { res = _CanStoreItem_InBag(i,dest,pProto,count,false,true,pItem,bag,slot); - if (res!=EQUIP_ERR_OK) + if (res != EQUIP_ERR_OK) continue; if (count == 0) @@ -13932,7 +13932,7 @@ void Player::AddQuest(Quest const *pQuest, Object *questGiver) questStatusData.uState = QUEST_CHANGED; //starting initial quest script - if (questGiver && pQuest->GetQuestStartScript()!=0) + if (questGiver && pQuest->GetQuestStartScript() != 0) GetMap()->ScriptsStart(sQuestStartScripts, pQuest->GetQuestStartScript(), questGiver, this); // Some spells applied at quest activation @@ -14433,7 +14433,7 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg) ObjectMgr::ExclusiveQuestGroups::iterator iter = objmgr.mExclusiveQuestGroups.lower_bound(qInfo->GetExclusiveGroup()); ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qInfo->GetExclusiveGroup()); - assert(iter!=end); // always must be found if qInfo->ExclusiveGroup != 0 + assert(iter != end); // always must be found if qInfo->ExclusiveGroup != 0 for (; iter != end; ++iter) { @@ -18166,7 +18166,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent) m_temporaryUnsummonedPetNumber = 0; } - if (!pet || pet->GetOwnerGUID()!=GetGUID()) + if (!pet || pet->GetOwnerGUID() != GetGUID()) return; pet->CombatStop(); @@ -19182,14 +19182,14 @@ void Player::InitDataForForm(bool reapplyMods) case FORM_GHOUL: case FORM_CAT: { - if (getPowerType()!=POWER_ENERGY) + if (getPowerType() != POWER_ENERGY) setPowerType(POWER_ENERGY); break; } case FORM_BEAR: case FORM_DIREBEAR: { - if (getPowerType()!=POWER_RAGE) + if (getPowerType() != POWER_RAGE) setPowerType(POWER_RAGE); break; } @@ -20702,7 +20702,7 @@ void Player::learnDefaultSpells() { // learn default race/class spells PlayerInfo const *info = objmgr.GetPlayerInfo(getRace(),getClass()); - for (PlayerCreateInfoSpells::const_iterator itr = info->spell.begin(); itr!=info->spell.end(); ++itr) + for (PlayerCreateInfoSpells::const_iterator itr = info->spell.begin(); itr != info->spell.end(); ++itr) { uint32 tspell = *itr; sLog.outDebug("PLAYER (Class: %u Race: %u): Adding initial spell, id = %u",uint32(getClass()),uint32(getRace()), tspell); @@ -20780,7 +20780,7 @@ void Player::learnQuestRewardedSpells(Quest const* quest) return; // compare only specializations - if (itrInfo->Effect[0]!=SPELL_EFFECT_TRADE_SKILL || itrInfo->Effect[1]!=0) + if (itrInfo->Effect[0] != SPELL_EFFECT_TRADE_SKILL || itrInfo->Effect[1] != 0) continue; // compare same chain spells @@ -20818,7 +20818,7 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value) for (uint32 j=0; j<sSkillLineAbilityStore.GetNumRows(); ++j) { SkillLineAbilityEntry const *pAbility = sSkillLineAbilityStore.LookupEntry(j); - if (!pAbility || pAbility->skillId!=skill_id || pAbility->learnOnGetSkill != ABILITY_LEARNED_ON_GET_PROFESSION_SKILL) + if (!pAbility || pAbility->skillId != skill_id || pAbility->learnOnGetSkill != ABILITY_LEARNED_ON_GET_PROFESSION_SKILL) continue; // Check race if set if (pAbility->racemask && !(pAbility->racemask & raceMask)) @@ -21020,7 +21020,7 @@ void Player::UpdateForQuestWorldObjects() UpdateData udata; WorldPacket packet; - for (ClientGUIDs::iterator itr=m_clientGUIDs.begin(); itr!=m_clientGUIDs.end(); ++itr) + for (ClientGUIDs::iterator itr=m_clientGUIDs.begin(); itr != m_clientGUIDs.end(); ++itr) { if (IS_GAMEOBJECT_GUID(*itr)) { @@ -21228,7 +21228,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item * pItem) // currently casted spells can be dependent from item for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i) if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i))) - if (spell->getState()!=SPELL_STATE_DELAYED && !HasItemFitToSpellReqirements(spell->m_spellInfo,pItem)) + if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellReqirements(spell->m_spellInfo,pItem)) InterruptSpell(CurrentSpellTypes(i)); } diff --git a/src/game/Player.h b/src/game/Player.h index b0123fb82d3..938df014dbf 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2185,7 +2185,7 @@ class Player : public Unit, public GridObject<Player> typedef std::set<uint64> ClientGUIDs; ClientGUIDs m_clientGUIDs; - bool HaveAtClient(WorldObject const* u) const { return u == this || m_clientGUIDs.find(u->GetGUID())!=m_clientGUIDs.end(); } + bool HaveAtClient(WorldObject const* u) const { return u == this || m_clientGUIDs.find(u->GetGUID()) != m_clientGUIDs.end(); } bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const; bool IsVisibleInGridForPlayer(Player const* pl) const; diff --git a/src/game/PlayerDump.cpp b/src/game/PlayerDump.cpp index d0dca3cdfc3..2ec23b6bd05 100644 --- a/src/game/PlayerDump.cpp +++ b/src/game/PlayerDump.cpp @@ -601,7 +601,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s //store a map of old pet id to new inserted pet id for use by type 5 tables snprintf(currpetid, 20, "%s", getnth(line, 1).c_str()); if (strlen(lastpetid) == 0) snprintf(lastpetid, 20, "%s", currpetid); - if (strcmp(lastpetid,currpetid)!=0) + if (strcmp(lastpetid,currpetid) != 0) { snprintf(newpetid, 20, "%d", objmgr.GeneratePetNumber()); snprintf(lastpetid, 20, "%s", currpetid); diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp index af6d8691a5f..0b5a55623e0 100644 --- a/src/game/PoolHandler.cpp +++ b/src/game/PoolHandler.cpp @@ -638,7 +638,7 @@ void PoolHandler::LoadFromDB() { std::ostringstream ss; ss<< "The pool(s) "; - for (std::set<uint16>::const_iterator itr=checkedPools.begin(); itr!=checkedPools.end(); ++itr) + for (std::set<uint16>::const_iterator itr=checkedPools.begin(); itr != checkedPools.end(); ++itr) ss << *itr << " "; ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool " << poolItr->first << " and child pool " << poolItr->second; diff --git a/src/game/ScriptedGuardAI.cpp b/src/game/ScriptedGuardAI.cpp index e99815aa7e5..83cc8c20479 100644 --- a/src/game/ScriptedGuardAI.cpp +++ b/src/game/ScriptedGuardAI.cpp @@ -143,7 +143,7 @@ void guardAI::UpdateAI(const uint32 diff) if (info && !GlobalCooldown) { //If we are currently moving stop us and set the movement generator - if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType()!=IDLE_MOTION_TYPE) + if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) { (*m_creature).GetMotionMaster()->Clear(false); (*m_creature).GetMotionMaster()->MoveIdle(); @@ -157,7 +157,7 @@ void guardAI::UpdateAI(const uint32 diff) GlobalCooldown = GENERIC_CREATURE_COOLDOWN; } //If no spells available and we arn't moving run to target - else if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType()!=TARGETED_MOTION_TYPE) + else if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) { //Cancel our current spell and then mutate new movement generator m_creature->InterruptNonMeleeSpells(false); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 33dd018a833..6bd54b344ff 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1052,7 +1052,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) SpellMissInfo missInfo = target->missCondition; // Need init unitTarget by default unit (can changed in code on reflect) - // Or on missInfo!=SPELL_MISS_NONE unitTarget undefined (but need in trigger subsystem) + // Or on missInfo != SPELL_MISS_NONE unitTarget undefined (but need in trigger subsystem) unitTarget = unit; // Reset damage/healing counter @@ -1068,7 +1068,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) //Spells with this flag cannot trigger if effect is casted on self // Slice and Dice, relentless strikes, eviscerate - bool canEffectTrigger = unitTarget->CanProc() && (m_spellInfo->AttributesEx4 & (SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST) ? m_caster!=unitTarget : true); + bool canEffectTrigger = unitTarget->CanProc() && (m_spellInfo->AttributesEx4 & (SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST) ? m_caster != unitTarget : true); Unit * spellHitTarget = NULL; if (missInfo == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target @@ -4108,7 +4108,7 @@ void Spell::TakePower() for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) if (ihit->targetGUID == targetGUID) { - if (ihit->missCondition != SPELL_MISS_NONE && ihit->missCondition != SPELL_MISS_MISS/* && ihit->targetGUID!=m_caster->GetGUID()*/) + if (ihit->missCondition != SPELL_MISS_NONE && ihit->missCondition != SPELL_MISS_MISS/* && ihit->targetGUID != m_caster->GetGUID()*/) hit = false; if (ihit->missCondition != SPELL_MISS_NONE) { @@ -4399,7 +4399,7 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar void Spell::TriggerSpell() { - for (TriggerSpells::iterator si=m_TriggerSpells.begin(); si!=m_TriggerSpells.end(); ++si) + for (TriggerSpells::iterator si=m_TriggerSpells.begin(); si != m_TriggerSpells.end(); ++si) { Spell* spell = new Spell(m_caster, (*si), true, m_originalCasterGUID, m_selfContainer, true); spell->prepare(&m_targets); // use original spell original targets @@ -4791,7 +4791,7 @@ SpellCastResult Spell::CheckCast(bool strict) cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); // Really don't know what is that??? - Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster,i_spellST->second.targetEntry,i_spellST->second.type!=SPELL_TARGET_TYPE_DEAD,range); + Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster,i_spellST->second.targetEntry,i_spellST->second.type != SPELL_TARGET_TYPE_DEAD,range); Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_caster, p_Creature, u_check); TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher); @@ -4818,7 +4818,7 @@ SpellCastResult Spell::CheckCast(bool strict) { m_targets.setDst(creatureScriptTarget->GetPositionX(),creatureScriptTarget->GetPositionY(),creatureScriptTarget->GetPositionZ()); - if (m_spellInfo->EffectImplicitTargetA[j] == TARGET_DST_NEARBY_ENTRY && m_spellInfo->EffectImplicitTargetB[j] == 0 && m_spellInfo->Effect[j]!=SPELL_EFFECT_PERSISTENT_AREA_AURA) + if (m_spellInfo->EffectImplicitTargetA[j] == TARGET_DST_NEARBY_ENTRY && m_spellInfo->EffectImplicitTargetB[j] == 0 && m_spellInfo->Effect[j] != SPELL_EFFECT_PERSISTENT_AREA_AURA) AddUnitTarget(creatureScriptTarget, j); } // store explicit target for TARGET_UNIT_NEARBY_ENTRY @@ -4833,7 +4833,7 @@ SpellCastResult Spell::CheckCast(bool strict) { m_targets.setDst(goScriptTarget->GetPositionX(),goScriptTarget->GetPositionY(),goScriptTarget->GetPositionZ()); - if (m_spellInfo->EffectImplicitTargetA[j] == TARGET_DST_NEARBY_ENTRY && m_spellInfo->EffectImplicitTargetB[j] == 0 && m_spellInfo->Effect[j]!=SPELL_EFFECT_PERSISTENT_AREA_AURA) + if (m_spellInfo->EffectImplicitTargetA[j] == TARGET_DST_NEARBY_ENTRY && m_spellInfo->EffectImplicitTargetB[j] == 0 && m_spellInfo->Effect[j] != SPELL_EFFECT_PERSISTENT_AREA_AURA) AddGOTarget(goScriptTarget, j); } // store explicit target for TARGET_UNIT_NEARBY_ENTRY @@ -5900,7 +5900,7 @@ SpellCastResult Spell::CheckItems() && (m_targets.getItemTarget()->IsWeaponVellum() || m_targets.getItemTarget()->IsArmorVellum())) { // cannot enchant vellum for other player - if (m_targets.getItemTarget()->GetOwner()!=m_caster) + if (m_targets.getItemTarget()->GetOwner() != m_caster) return SPELL_FAILED_NOT_TRADEABLE; // do not allow to enchant vellum from scroll made by vellum-prevent exploit if (m_CastItem && m_CastItem->GetProto()->Flags & ITEM_FLAGS_TRIGGERED_CAST) @@ -6948,13 +6948,13 @@ void Spell::FillRaidOrPartyTargets(UnitList &TagUnitMap, Unit* target, float rad && !m_caster->IsHostileTo(Target)) { if (Target == m_caster && withcaster || - Target!=m_caster && m_caster->IsWithinDistInMap(Target, radius)) + Target != m_caster && m_caster->IsWithinDistInMap(Target, radius)) TagUnitMap.push_back(Target); if (withPets) if (Pet* pet = Target->GetPet()) if (pet == m_caster && withcaster || - pet!=m_caster && m_caster->IsWithinDistInMap(pet, radius)) + pet != m_caster && m_caster->IsWithinDistInMap(pet, radius)) TagUnitMap.push_back(pet); } } @@ -6963,13 +6963,13 @@ void Spell::FillRaidOrPartyTargets(UnitList &TagUnitMap, Unit* target, float rad { Unit* ownerOrSelf = pTarget ? pTarget : target->GetCharmerOrOwnerOrSelf(); if (ownerOrSelf == m_caster && withcaster || - ownerOrSelf!=m_caster && m_caster->IsWithinDistInMap(ownerOrSelf, radius)) + ownerOrSelf != m_caster && m_caster->IsWithinDistInMap(ownerOrSelf, radius)) TagUnitMap.push_back(ownerOrSelf); if (withPets) if (Guardian* pet = ownerOrSelf->GetGuardianPet()) if (pet == m_caster && withcaster || - pet!=m_caster && m_caster->IsWithinDistInMap(pet, radius)) + pet != m_caster && m_caster->IsWithinDistInMap(pet, radius)) TagUnitMap.push_back(pet); } } diff --git a/src/game/SpellAuraEffects.cpp b/src/game/SpellAuraEffects.cpp index 26d0089f998..4cdc09492fa 100644 --- a/src/game/SpellAuraEffects.cpp +++ b/src/game/SpellAuraEffects.cpp @@ -868,7 +868,7 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark) { Unit * caster = GetCaster(); // Reapply if amount change - if (newAmount!=GetAmount()) + if (newAmount != GetAmount()) { UnitList targetList; GetTargetList(targetList); @@ -1322,7 +1322,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const return; if (GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_PERSISTENT_AREA_AURA && - caster->SpellHitResult(target,GetSpellProto(),false)!=SPELL_MISS_NONE) + caster->SpellHitResult(target,GetSpellProto(),false) != SPELL_MISS_NONE) return; // Check for immune @@ -1830,7 +1830,7 @@ void AuraEffect::PeriodicDummyTick(Unit * target, Unit * caster) const { // Converts up to 10 rage per second into health for $d. Each point of rage is converted into ${$m2/10}.1% of max health. // Should be manauser - if (target->getPowerType()!=POWER_RAGE) + if (target->getPowerType() != POWER_RAGE) break; uint32 rage = target->GetPower(POWER_RAGE); // Nothing todo @@ -2047,7 +2047,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const return; // Inoculate Nestlewood Owlkin case 29528: - if (triggerTarget->GetTypeId()!=TYPEID_UNIT)// prevent error reports in case ignored player target + if (triggerTarget->GetTypeId() != TYPEID_UNIT)// prevent error reports in case ignored player target return; break; // Feed Captured Animal @@ -2241,7 +2241,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, 0, this); sLog.outDebug("AuraEffect::TriggerSpell: Spell %u Trigger %u",GetId(), triggeredSpellInfo->Id); } - else if (target->GetTypeId()!=TYPEID_UNIT || !sScriptMgr.EffectDummyCreature(caster, GetId(), GetEffIndex(), triggerTarget->ToCreature())) + else if (target->GetTypeId() != TYPEID_UNIT || !sScriptMgr.EffectDummyCreature(caster, GetId(), GetEffIndex(), triggerTarget->ToCreature())) sLog.outError("AuraEffect::TriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",GetId(),GetEffIndex()); } @@ -2709,7 +2709,7 @@ void AuraEffect::HandlePhase(AuraApplication const * aurApp, uint8 mode, bool ap target->SetPhaseMask((apply) ? GetMiscValue() : PHASEMASK_NORMAL,false); // need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases) - if (target->GetVisibility()!=VISIBILITY_OFF) + if (target->GetVisibility() != VISIBILITY_OFF) target->SetVisibility(target->GetVisibility()); } @@ -5043,7 +5043,7 @@ void AuraEffect::HandleAuraModRangedAttackPower(AuraApplication const * aurApp, Unit * target = aurApp->GetTarget(); - if ((target->getClassMask() & CLASSMASK_WAND_USERS)!=0) + if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0) return; target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(GetAmount()), apply); @@ -5067,7 +5067,7 @@ void AuraEffect::HandleAuraModRangedAttackPowerPercent(AuraApplication const * a Unit * target = aurApp->GetTarget(); - if ((target->getClassMask() & CLASSMASK_WAND_USERS)!=0) + if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0) return; //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1 diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index a41445e0e13..89d9752496f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1081,7 +1081,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, // aura remove - remove auras from all party members std::list<Unit*> PartyMembers; target->GetPartyMembers(PartyMembers); - for (std::list<Unit*>::iterator itr = PartyMembers.begin(); itr!=PartyMembers.end(); ++itr) + for (std::list<Unit*>::iterator itr = PartyMembers.begin(); itr != PartyMembers.end(); ++itr) { if ((*itr)!= target) (*itr)->RemoveAurasWithFamily(SPELLFAMILY_WARRIOR, 0, 0x2, 0, GetCasterGUID()); @@ -1125,7 +1125,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, // Do not remove GO when aura is removed by stack // to prevent remove GO added by new spell // old one is already removed - if (removeMode!=AURA_REMOVE_BY_STACK) + if (removeMode != AURA_REMOVE_BY_STACK) target->RemoveGameObject(GetId(), true); target->RemoveAura(62388); break; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 4785d5db806..37d80381fa9 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1732,7 +1732,7 @@ void Spell::EffectDummy(uint32 i) for (int s=0; s<3; s++) { - if (pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; SpellEntry const* combatEntry = sSpellStore.LookupEntry(pEnchant->spellid[s]); @@ -2116,7 +2116,7 @@ void Spell::EffectDummy(uint32 i) else if (m_spellInfo->SpellIconID == 1737) { // Dummy effect 1 is used only for targeting and damage amount - if (i!=0) + if (i != 0) return; int32 bp = 0; // Living ghoul as a target @@ -2470,7 +2470,7 @@ void Spell::EffectJump(uint32 i) // explicit cast data from client or server-side cast // some spell at client send caster Unit* pTarget = NULL; - if (m_targets.getUnitTarget() && m_targets.getUnitTarget()!=m_caster) + if (m_targets.getUnitTarget() && m_targets.getUnitTarget() != m_caster) pTarget = m_targets.getUnitTarget(); else if (m_caster->getVictim()) pTarget = m_caster->getVictim(); @@ -2744,7 +2744,7 @@ void Spell::EffectPowerBurn(uint32 i) return; if (!unitTarget->isAlive()) return; - if (unitTarget->getPowerType()!=powertype) + if (unitTarget->getPowerType() != powertype) return; if (damage < 0) return; @@ -4060,7 +4060,7 @@ void Spell::EffectEnchantItemPerm(uint32 effect_idx) if (!item_owner) return; - if (item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) + if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) { sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", p_caster->GetName(),p_caster->GetSession()->GetAccountId(), @@ -4539,7 +4539,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i) else { Unit::AuraApplicationMap const& auras = unitTarget->GetAppliedAuras(); - for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) + for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) { if (itr->second->GetBase()->GetSpellProto()->Dispel == DISPEL_POISON) { @@ -5502,7 +5502,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) case 58418: // Portal to Orgrimmar case 58420: // Portal to Stormwind { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || effIndex!=0) + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || effIndex != 0) return; uint32 spellID = m_spellInfo->CalculateSimpleValue(0); @@ -7314,7 +7314,7 @@ void Spell::EffectStealBeneficialBuff(uint32 i) data << uint32(m_spellInfo->Id); // dispel spell id data << uint8(0); // not used data << uint32(success_list.size()); // count - for (DispelList::iterator itr = success_list.begin(); itr!=success_list.end(); ++itr) + for (DispelList::iterator itr = success_list.begin(); itr != success_list.end(); ++itr) { data << uint32(itr->first); // Spell Id data << uint8(0); // 0 - steals !=0 transfers diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index b3c9dbb10f3..b8a4a127824 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -614,7 +614,7 @@ void WorldSession::HandleMirrrorImageDataRequest(WorldPacket & recv_data) }; // Display items in visible slots - for (EquipmentSlots const* itr = &ItemSlots[0]; *itr!=EQUIPMENT_SLOT_END; ++itr) + for (EquipmentSlots const* itr = &ItemSlots[0]; *itr != EQUIPMENT_SLOT_END; ++itr) { if (*itr == EQUIPMENT_SLOT_HEAD && pCreator->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM)) data << uint32(0); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 4c23ecb907b..d318467a7fe 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2215,8 +2215,8 @@ void SpellMgr::LoadPetLevelupSpellMap() if (!skillLine) continue; - //if (skillLine->skillId!=creatureFamily->skillLine[0] && - // (!creatureFamily->skillLine[1] || skillLine->skillId!=creatureFamily->skillLine[1])) + //if (skillLine->skillId != creatureFamily->skillLine[0] && + // (!creatureFamily->skillLine[1] || skillLine->skillId != creatureFamily->skillLine[1])) // continue; if (skillLine->skillId != creatureFamily->skillLine[j]) diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp index 8b5a250320f..448a6e0520d 100644 --- a/src/game/TradeHandler.cpp +++ b/src/game/TradeHandler.cpp @@ -613,7 +613,7 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket) // check cheating, can't fail with correct client operations Item* item = _player->GetItemByPos(bag,slot); - if (!item || (tradeSlot!=TRADE_SLOT_NONTRADED && !item->CanBeTraded())) + if (!item || (tradeSlot != TRADE_SLOT_NONTRADED && !item->CanBeTraded())) { SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); return; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 16b1b3fed52..88a6ddf59b6 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -856,7 +856,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa void Unit::CastStop(uint32 except_spellid) { for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++) - if (m_currentSpells[i] && m_currentSpells[i]->m_spellInfo->Id!=except_spellid) + if (m_currentSpells[i] && m_currentSpells[i]->m_spellInfo->Id != except_spellid) InterruptSpell(CurrentSpellTypes(i),false); } @@ -4257,7 +4257,7 @@ void Unit::RemoveAreaAurasDueToLeaveWorld() // remove area auras owned by others for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();) { - if (iter->second->GetBase()->GetOwner()!=this) + if (iter->second->GetBase()->GetOwner() != this) { RemoveAura(iter); cleanRun = false; @@ -4401,7 +4401,7 @@ AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 f SpellEntry const *spell = (*i)->GetSpellProto(); if (spell->SpellFamilyName == family && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3)) { - if (casterGUID && (*i)->GetCasterGUID()!=casterGUID) + if (casterGUID && (*i)->GetCasterGUID() != casterGUID) continue; return (*i); } @@ -4414,7 +4414,7 @@ AuraApplication * Unit::GetAuraApplication(uint32 spellId, uint64 casterGUID, ui for (AuraApplicationMap::const_iterator itr = m_appliedAuras.lower_bound(spellId); itr != m_appliedAuras.upper_bound(spellId); ++itr) { Aura const * aura = itr->second->GetBase(); - if (((aura->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || aura->GetCasterGUID() == casterGUID) && (!except || except!=itr->second)) + if (((aura->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || aura->GetCasterGUID() == casterGUID) && (!except || except != itr->second)) return itr->second; } return NULL; @@ -5109,7 +5109,7 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger } // default case - if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target!=this && !target->isAlive())) + if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -5171,7 +5171,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /*damage*/, AuraE } // default case - if (!target || target!=this && !target->isAlive()) + if (!target || target != this && !target->isAlive()) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -5638,7 +5638,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Hot Streak if (dummySpell->SpellIconID == 2999) { - if (effIndex!=0) + if (effIndex != 0) return false; AuraEffect *counter = triggeredByAura->GetBase()->GetEffect(1); if (!counter) @@ -6001,7 +6001,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (!pVictim || !pVictim->isAlive()) return false; - if (effIndex!=0) + if (effIndex != 0) return false; // pVictim is caster of aura @@ -6455,7 +6455,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage) if (dummySpell->SpellFamilyFlags[0]&0x8000000) { - if (effIndex!=0) + if (effIndex != 0) return false; triggered_spell_id = 25742; float ap = GetTotalAttackPowerValue(BASE_ATTACK); @@ -6814,7 +6814,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Windfury Weapon (Passive) 1-5 Ranks case 33757: { - if (GetTypeId()!=TYPEID_PLAYER || !castItem || !castItem->IsEquipped() || !pVictim || !pVictim->isAlive()) + if (GetTypeId() != TYPEID_PLAYER || !castItem || !castItem->IsEquipped() || !pVictim || !pVictim->isAlive()) return false; // custom cooldown processing case @@ -7000,7 +7000,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Flametongue Weapon (Passive) if (dummySpell->SpellFamilyFlags[0] & 0x200000) { - if (GetTypeId()!=TYPEID_PLAYER || !pVictim || !pVictim->isAlive() || !castItem || !castItem->IsEquipped()) + if (GetTypeId() != TYPEID_PLAYER || !pVictim || !pVictim->isAlive() || !castItem || !castItem->IsEquipped()) return false; // firehit = dummySpell->EffectBasePoints[0] / ((4*19.25) * 1.3); @@ -7181,7 +7181,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (dummySpell->Id == 49028) { // 1 dummy aura for dismiss rune blade - if (effIndex!=2) + if (effIndex != 2) return false; uint64 PetGUID = NULL; for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr) //Find Rune Weapon @@ -7422,7 +7422,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger } // default case - if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target!=this && !target->isAlive())) + if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -7481,7 +7481,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* } // default case - if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target!=this && !target->isAlive())) + if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -7538,7 +7538,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEff } // default case - if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target!=this && !target->isAlive())) + if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -8277,7 +8277,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig // Enlightenment (trigger only from mana cost spells) case 35095: { - if (!procSpell || procSpell->powerType!=POWER_MANA || procSpell->manaCost == 0 && procSpell->ManaCostPercentage == 0 && procSpell->manaCostPerlevel == 0) + if (!procSpell || procSpell->powerType != POWER_MANA || procSpell->manaCost == 0 && procSpell->ManaCostPercentage == 0 && procSpell->manaCostPerlevel == 0) return false; break; } @@ -8386,7 +8386,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig target = !(procFlags & (PROC_FLAG_SUCCESSFUL_POSITIVE_MAGIC_SPELL | PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL_HIT)) && IsPositiveSpell(trigger_spell_id) ? this : pVictim; // default case - if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target!=this && !target->isAlive())) + if ((!target && !spellmgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (basepoints0) @@ -8416,21 +8416,21 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraE { case 836: // Improved Blizzard (Rank 1) { - if (!procSpell || procSpell->SpellVisual[0]!=9487) + if (!procSpell || procSpell->SpellVisual[0] != 9487) return false; triggered_spell_id = 12484; break; } case 988: // Improved Blizzard (Rank 2) { - if (!procSpell || procSpell->SpellVisual[0]!=9487) + if (!procSpell || procSpell->SpellVisual[0] != 9487) return false; triggered_spell_id = 12485; break; } case 989: // Improved Blizzard (Rank 3) { - if (!procSpell || procSpell->SpellVisual[0]!=9487) + if (!procSpell || procSpell->SpellVisual[0] != 9487) return false; triggered_spell_id = 12486; break; @@ -9531,7 +9531,7 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius) if (!pGroup) { // We are pet now, return owner - if (player!=this) + if (player != this) return IsWithinDistInMap(player, radius) ? player : NULL; Unit * pet = GetGuardianPet(); //No pet, no group, nothing to return @@ -9862,7 +9862,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 // Get stack of Holy Vengeance/Blood Corruption on the target added by caster uint32 stacks = 0; Unit::AuraEffectList const& auras = pVictim->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE); - for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) + for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) if (((*itr)->GetId() == 31803 || (*itr)->GetId() == 53742) && (*itr)->GetCasterGUID() == GetGUID()) { stacks = (*itr)->GetBase()->GetStackAmount(); @@ -10452,7 +10452,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint for (AuraApplicationMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr) { Aura const * aura = itr->second->GetBase(); - if (aura->GetCasterGUID()!=GetGUID()) + if (aura->GetCasterGUID() != GetGUID()) continue; SpellEntry const* m_spell = aura->GetSpellProto(); if (m_spell->SpellFamilyName != SPELLFAMILY_DRUID || @@ -10939,7 +10939,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att if ((*i)->GetMiscValue() & GetMeleeDamageSchoolMask()) TakenFlatBenefit += (*i)->GetAmount(); - if (attType!=RANGED_ATTACK) + if (attType != RANGED_ATTACK) TakenFlatBenefit += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN); else TakenFlatBenefit += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN); @@ -11092,7 +11092,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) { AuraEffect* eff0 = (*i)->GetBase()->GetEffect(0); - if (!eff0 || (*i)->GetEffIndex()!=1) + if (!eff0 || (*i)->GetEffIndex() != 1) { sLog.outError("Spell structure of DD (%u) changed.",(*i)->GetId()); continue; @@ -12973,9 +12973,9 @@ uint32 Unit::GetCreatePowers(Powers power) const { case POWER_MANA: return GetCreateMana(); case POWER_RAGE: return 1000; - case POWER_FOCUS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType()!=HUNTER_PET ? 0 : 100); + case POWER_FOCUS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 100); case POWER_ENERGY: return 100; - case POWER_HAPPINESS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType()!=HUNTER_PET ? 0 : 1050000); + case POWER_HAPPINESS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 1050000); case POWER_RUNIC_POWER: return 1000; case POWER_RUNE: return 0; case POWER_HEALTH: return 0; diff --git a/src/game/World.cpp b/src/game/World.cpp index 47294a89107..10eec0e5b32 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -637,7 +637,7 @@ void World::LoadConfigSettings(bool reload) if (reload) { uint32 val = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT); - if (val!=m_configs[CONFIG_PORT_WORLD]) + if (val != m_configs[CONFIG_PORT_WORLD]) sLog.outError("WorldServerPort option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_PORT_WORLD]); } else @@ -646,7 +646,7 @@ void World::LoadConfigSettings(bool reload) if (reload) { uint32 val = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME); - if (val!=m_configs[CONFIG_SOCKET_SELECTTIME]) + if (val != m_configs[CONFIG_SOCKET_SELECTTIME]) sLog.outError("SocketSelectTime option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_SOCKET_SELECTTIME]); } else @@ -661,7 +661,7 @@ void World::LoadConfigSettings(bool reload) if (reload) { uint32 val = sConfig.GetIntDefault("GameType", 0); - if (val!=m_configs[CONFIG_GAME_TYPE]) + if (val != m_configs[CONFIG_GAME_TYPE]) sLog.outError("GameType option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_GAME_TYPE]); } else @@ -670,7 +670,7 @@ void World::LoadConfigSettings(bool reload) if (reload) { uint32 val = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); - if (val!=m_configs[CONFIG_REALM_ZONE]) + if (val != m_configs[CONFIG_REALM_ZONE]) sLog.outError("RealmZone option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_REALM_ZONE]); } else @@ -747,7 +747,7 @@ void World::LoadConfigSettings(bool reload) if (reload) { uint32 val = sConfig.GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL); - if (val!=m_configs[CONFIG_MAX_PLAYER_LEVEL]) + if (val != m_configs[CONFIG_MAX_PLAYER_LEVEL]) sLog.outError("MaxPlayerLevel option can't be changed at config reload, using current value (%u).",m_configs[CONFIG_MAX_PLAYER_LEVEL]); } else @@ -974,7 +974,7 @@ void World::LoadConfigSettings(bool reload) if (reload) { uint32 val = sConfig.GetIntDefault("Expansion",1); - if (val!=m_configs[CONFIG_EXPANSION]) + if (val != m_configs[CONFIG_EXPANSION]) sLog.outError("Expansion option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]); } else @@ -1151,12 +1151,12 @@ void World::LoadConfigSettings(bool reload) ///- Read the "Data" directory from the config file std::string dataPath = sConfig.GetStringDefault("DataDir","./"); - if (dataPath.at(dataPath.length()-1)!='/' && dataPath.at(dataPath.length()-1)!='\\') + if (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\') dataPath.append("/"); if (reload) { - if (dataPath!=m_dataPath) + if (dataPath != m_dataPath) sLog.outError("DataDir option can't be changed at Trinityd.conf reload, using current value (%s).",m_dataPath.c_str()); } else @@ -2211,7 +2211,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura Field* fieldsAccount = resultAccounts->Fetch(); uint32 account = fieldsAccount->GetUInt32(); - if (mode!=BAN_IP) + if (mode != BAN_IP) { //No SQL injection as strings are escaped loginDatabase.PExecute("INSERT INTO account_banned VALUES ('%u', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+%u, '%s', '%s', '1')", diff --git a/src/game/World.h b/src/game/World.h index 817ddf748cc..b1188ba688f 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -404,7 +404,7 @@ enum RealmZone #define SCRIPT_COMMAND_OPEN_DOOR 11 // source = unit, datalong=db_guid, datalong2=reset_delay #define SCRIPT_COMMAND_CLOSE_DOOR 12 // source = unit, datalong=db_guid, datalong2=reset_delay #define SCRIPT_COMMAND_ACTIVATE_OBJECT 13 // source = unit, target=GO -#define SCRIPT_COMMAND_REMOVE_AURA 14 // source (datalong2!=0) or target (datalong == 0) unit, datalong = spell_id +#define SCRIPT_COMMAND_REMOVE_AURA 14 // source (datalong2 != 0) or target (datalong == 0) unit, datalong = spell_id #define SCRIPT_COMMAND_CAST_SPELL 15 // source/target cast spell at target/source (script->datalong2: 0: s->t 1: s->s 2: t->t 3: t->s #define SCRIPT_COMMAND_PLAY_SOUND 16 // source = any object, target=any/player, datalong (sound_id), datalong2 (bitmask: 0/1=anyone/target, 0/2=with distance dependent, so 1|2 = 3 is target with distance dependent) #define SCRIPT_COMMAND_LOAD_PATH 20 // source = unit, path = datalong, repeatable datalong2 diff --git a/src/game/WorldLog.cpp b/src/game/WorldLog.cpp index a80e8711424..7c6c4020336 100644 --- a/src/game/WorldLog.cpp +++ b/src/game/WorldLog.cpp @@ -50,7 +50,7 @@ void WorldLog::Initialize() if (!logsDir.empty()) { - if ((logsDir.at(logsDir.length()-1)!='/') && (logsDir.at(logsDir.length()-1)!='\\')) + if ((logsDir.at(logsDir.length()-1) != '/') && (logsDir.at(logsDir.length()-1) != '\\')) logsDir.append("/"); } diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp index 6420c4d34d2..888d222712a 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp @@ -170,7 +170,7 @@ struct boss_netherspiteAI : public ScriptedAI Map::PlayerList const& players = map->GetPlayers(); // get the best suitable target - for (Map::PlayerList::const_iterator i = players.begin(); i!=players.end(); ++i) + for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) { Player* p = i->getSource(); if (p && p->isAlive() // alive diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp index 75f3dbead83..03b8efc1903 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp @@ -475,9 +475,9 @@ struct boss_aranAI : public ScriptedAI void SpellHit(Unit* pAttacker, const SpellEntry* Spell) { //We only care about inturrupt effects and only if they are durring a spell currently being casted - if ((Spell->Effect[0]!=SPELL_EFFECT_INTERRUPT_CAST && - Spell->Effect[1]!=SPELL_EFFECT_INTERRUPT_CAST && - Spell->Effect[2]!=SPELL_EFFECT_INTERRUPT_CAST) || !m_creature->IsNonMeleeSpellCasted(false)) + if ((Spell->Effect[0] != SPELL_EFFECT_INTERRUPT_CAST && + Spell->Effect[1] != SPELL_EFFECT_INTERRUPT_CAST && + Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !m_creature->IsNonMeleeSpellCasted(false)) return; //Inturrupt effect diff --git a/src/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp b/src/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp index 8140b3741ff..95e77c5c22a 100644 --- a/src/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp +++ b/src/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp @@ -134,7 +134,7 @@ struct instance_uldaman : public ScriptedInstance for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) { Creature *pTarget = instance->GetCreature(*i); - if (!pTarget || pTarget->isDead() || pTarget->getFaction()!=14) + if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14) continue; pTarget->setDeathState(JUST_DIED); pTarget->RemoveCorpse(); @@ -144,7 +144,7 @@ struct instance_uldaman : public ScriptedInstance for (std::vector<uint64>::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) { Creature *pTarget = instance->GetCreature(*i); - if (!pTarget || pTarget->isDead() || pTarget->getFaction()!=14) + if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14) continue; pTarget->setDeathState(JUST_DIED); pTarget->RemoveCorpse(); @@ -154,7 +154,7 @@ struct instance_uldaman : public ScriptedInstance for (std::vector<uint64>::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) { Creature *pTarget = instance->GetCreature(*i); - if (!pTarget || pTarget->isDead() || pTarget->getFaction()!=14) + if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14) continue; pTarget->setDeathState(JUST_DIED); pTarget->RemoveCorpse(); diff --git a/src/scripts/examples/example_gossip_codebox.cpp b/src/scripts/examples/example_gossip_codebox.cpp index b5ff766c511..0506c9ada42 100644 --- a/src/scripts/examples/example_gossip_codebox.cpp +++ b/src/scripts/examples/example_gossip_codebox.cpp @@ -67,7 +67,7 @@ bool GossipSelectWithCode_example_gossip_codebox(Player* pPlayer, Creature* pCre switch (uiAction) { case GOSSIP_ACTION_INFO_DEF+1: - if (std::strcmp(sCode, pPlayer->GetName())!=0) + if (std::strcmp(sCode, pPlayer->GetName()) != 0) { DoScriptText(SAY_WRONG, pCreature); pCreature->CastSpell(pPlayer, SPELL_POLYMORPH, true); diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp index 4f78c361fa2..ea5cece3a08 100644 --- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp +++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp @@ -531,7 +531,7 @@ struct boss_veklorAI : public boss_twinemperorsAI if (ArcaneBurst_Timer <= diff) { Unit *mvic; - if ((mvic=SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true))!=NULL) + if ((mvic=SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true)) != NULL) { DoCast(mvic, SPELL_ARCANEBURST); ArcaneBurst_Timer = 5000; diff --git a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp index b5c4981878a..f29b2b75d69 100644 --- a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp +++ b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp @@ -205,7 +205,7 @@ struct boss_volazjAI : public ScriptedAI Summons.Despawn(summon); // Check if all summons in this phase killed - for (SummonList::const_iterator iter = Summons.begin(); iter!=Summons.end(); ++iter) + for (SummonList::const_iterator iter = Summons.begin(); iter != Summons.end(); ++iter) { if (Creature *visage = Unit::GetCreature(*m_creature, *iter)) { diff --git a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp index 3c6d4875ae8..d2c0c9cbb7b 100644 --- a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp +++ b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp @@ -145,7 +145,7 @@ struct boss_palehoofAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if (currentPhase!=PHASE_GORTOK_PALEHOOF) + if (currentPhase != PHASE_GORTOK_PALEHOOF) return; //Return since we have no target if (!UpdateVictim()) diff --git a/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp index 51f3419c887..c65e5ad838b 100644 --- a/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp +++ b/src/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp @@ -191,7 +191,7 @@ struct boss_vazrudenAI : public ScriptedAI void KilledUnit(Unit* who) { - if (who && who->GetEntry()!=ENTRY_VAZRUDEN) + if (who && who->GetEntry() != ENTRY_VAZRUDEN) DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature); } diff --git a/src/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp b/src/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp index 1287bfa290e..0bc2226df19 100644 --- a/src/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp +++ b/src/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp @@ -326,7 +326,7 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI m_creature->GetMap()->CreatureRelocation(m_creature, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); for (int j=0; j <= 2; j++) - if (j!=i) + if (j != i) SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); |