diff --git a/cmake/cotire.cmake b/cmake/cotire.cmake new file mode 100644 index 000000000..e69de29bb diff --git a/src/game/AddonHandler.cpp b/src/game/AddonHandler.cpp index 72ec5f507..c68638acc 100644 --- a/src/game/AddonHandler.cpp +++ b/src/game/AddonHandler.cpp @@ -73,7 +73,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target) AddOnPacked.resize(AddonRealSize); // resize target for zlib action - if (!uncompress(const_cast(AddOnPacked.contents()), &AddonRealSize, const_cast((*Source).contents() + CurrentPosition), (*Source).size() - CurrentPosition) != Z_OK) + if (Z_OK == uncompress(const_cast(AddOnPacked.contents()), &AddonRealSize, const_cast((*Source).contents() + CurrentPosition), (*Source).size() - CurrentPosition)) { Target->Initialize(SMSG_ADDON_INFO); diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 95f88eb01..3c757d154 100755 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -2366,7 +2366,7 @@ void Creature::AllLootRemovedFromCorpse() m_respawnTime = m_corpseRemoveTime + m_respawnDelay; } -uint8 Creature::getLevelForTarget(Unit const* target) const +uint8 Creature::getLevelForTarget(WorldObject const* target) const { if (!isWorldBoss() || !target->ToUnit()) return Unit::getLevelForTarget(target); diff --git a/src/game/Creature.h b/src/game/Creature.h index 96d293670..0c0e28512 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -516,7 +516,7 @@ class Creature : public Unit, public GridObject bool isElite() const; bool isWorldBoss() const; - uint8 getLevelForTarget(Unit const* target) const; // overwrite Unit::getLevelForTarget for boss level support + uint8 getLevelForTarget(WorldObject const* target) const override; // overwrite Unit::getLevelForTarget for boss level support bool IsInEvadeMode() const; @@ -551,7 +551,7 @@ class Creature : public Unit, public GridObject void UpdateAttackPowerAndDamage(bool ranged = false) override; void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) override; - void SetCanDualWield(bool value); + void SetCanDualWield(bool value) override; void SetCurrentEquipmentId(uint8 id) { m_equipmentId = id; } uint32 GetCurrentEquipmentId() { return m_equipmentId; } float GetSpellDamageMod(int32 Rank) const; diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index 68e6d7293..a2bc1e228 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -82,10 +82,10 @@ class CreatureAI : public UnitAI explicit CreatureAI(Creature* c) : UnitAI((Unit*)c), me(c), - m_MoveInLineOfSight_locked(false), CombatMovementEnabled(true), AttackDistance(0.0f), - AttackAngle(0.0f) + AttackAngle(0.0f), + m_MoveInLineOfSight_locked(false) {} ~CreatureAI() override {} @@ -128,7 +128,7 @@ class CreatureAI : public UnitAI virtual void SpellHitTarget(Unit* /*target*/, const SpellEntry*) {} // Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc) - virtual void AttackedBy(Unit* attacker) {} + virtual void AttackedBy(Unit* /*attacker*/) {} virtual bool IsEscorted() { diff --git a/src/game/CreatureTextMgr.cpp b/src/game/CreatureTextMgr.cpp index b7b0b029c..108235c74 100644 --- a/src/game/CreatureTextMgr.cpp +++ b/src/game/CreatureTextMgr.cpp @@ -493,7 +493,7 @@ bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) return true; } -std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 gender, uint8 textGroup, uint32 id, int loc_idx) const +std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 /*gender*/, uint8 textGroup, uint32 id, int loc_idx) const { CreatureTextMap::const_iterator mapitr = mTextMap.find(entry); if (mapitr == mTextMap.end()) diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index 08d6e8120..bb5723145 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -208,7 +208,7 @@ inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errlist, DBCS if (f) { char buf[100]; - snprintf(buf, 100, " (exists, but has %d fields instead %d) Wrong client version of DBC files?", storage.GetFieldCount(), strlen(storage.GetFormat())); + snprintf(buf, 100, " (exists, but has %d fields instead %lu) Wrong client version of DBC files?", storage.GetFieldCount(), strlen(storage.GetFormat())); errlist.push_back(dbc_filename + buf); fclose(f); } @@ -546,7 +546,7 @@ void LoadDBCStores(const std::string& dataPath) for (std::list::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i) str += *i + "\n"; - sLog.outFatal("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s", bad_dbc_files.size(), DBCFilesCount, str.c_str()); + sLog.outFatal("\nSome required *.dbc files (%lu from %d) not found or not compatible:\n%s", bad_dbc_files.size(), DBCFilesCount, str.c_str()); } // check at up-to-date DBC files (53085 is last added spell in 2.4.3) diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp index 97ec7f8e4..5df5dfcf0 100644 --- a/src/game/Debugcmds.cpp +++ b/src/game/Debugcmds.cpp @@ -266,7 +266,7 @@ bool ChatHandler::HandleDebugPlayCinematicCommand(const char* args) PSendSysMessage("%02u - %7ums [%f, %f, %f] Facing %f (%f degrees)", count, cam.timeStamp, cam.locations.x, cam.locations.y, cam.locations.z, cam.locations.w, cam.locations.w * (180 / M_PI)); count++; } - PSendSysMessage("%u waypoints dumped", itr->second.size()); + PSendSysMessage("%lu waypoints dumped", itr->second.size()); } } diff --git a/src/game/FleeingMovementGenerator.h b/src/game/FleeingMovementGenerator.h index 4cf044632..8b58b0251 100644 --- a/src/game/FleeingMovementGenerator.h +++ b/src/game/FleeingMovementGenerator.h @@ -28,12 +28,12 @@ class FleeingMovementGenerator public: FleeingMovementGenerator(uint64 fright) : i_frightGUID(fright), i_nextCheckTime(0) {} - void Initialize(T&); - void Finalize(T&); - void Reset(T&); - bool Update(T&, const uint32&); + void Initialize(T&) override; + void Finalize(T&) override; + void Reset(T&) override; + bool Update(T&, const uint32&) override; - MovementGeneratorType GetMovementGeneratorType() + MovementGeneratorType GetMovementGeneratorType() override { return FLEEING_MOTION_TYPE; } @@ -54,12 +54,12 @@ class TimedFleeingMovementGenerator FleeingMovementGenerator(fright), i_totalFleeTime(time) {} - MovementGeneratorType GetMovementGeneratorType() + MovementGeneratorType GetMovementGeneratorType() override { return TIMED_FLEEING_MOTION_TYPE; } - bool Update(Unit&, const uint32&); - void Finalize(Unit&); + bool Update(Unit&, const uint32&) override; + void Finalize(Unit&) override; private: TimeTracker i_totalFleeTime; diff --git a/src/game/Group.cpp b/src/game/Group.cpp index 85f9d943f..d8e923839 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -112,7 +112,7 @@ bool Group::Create(const uint64& guid, const char* name) CharacterDatabase.PExecute("DELETE FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid)); CharacterDatabase.PExecute("DELETE FROM group_member WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid)); CharacterDatabase.PExecute("INSERT INTO groups(leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid,difficulty,masterLooterGuid) " - "VALUES('%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','%u')", + "VALUES('%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','" UI64FMTD "')", GUID_LOPART(m_leaderGuid), GUID_LOPART(m_mainTank), GUID_LOPART(m_mainAssistant), uint32(m_lootMethod), GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], isRaidGroup(), m_difficulty, m_masterLooterGuid); } diff --git a/src/game/Group.h b/src/game/Group.h index f47951108..973be9a33 100644 --- a/src/game/Group.h +++ b/src/game/Group.h @@ -231,7 +231,7 @@ class Group { return m_lootMethod; } - const uint64 GetLooterGuid() const + uint64 GetLooterGuid() const { if (GetLootMethod() == FREE_FOR_ALL) return 0; diff --git a/src/game/GuardAI.h b/src/game/GuardAI.h index c9e00100d..7368394b8 100644 --- a/src/game/GuardAI.h +++ b/src/game/GuardAI.h @@ -34,8 +34,8 @@ class GuardAI : public ScriptedAI public: explicit GuardAI(Creature* creature); - void EnterEvadeMode(); - void JustDied(Unit*); + void EnterEvadeMode() override; + void JustDied(Unit*) override; static int Permissible(const Creature*); bool CanSeeAlways(WorldObject const* obj) override; diff --git a/src/game/HomeMovementGenerator.cpp b/src/game/HomeMovementGenerator.cpp index b2a265bf5..ccb111783 100644 --- a/src/game/HomeMovementGenerator.cpp +++ b/src/game/HomeMovementGenerator.cpp @@ -68,7 +68,7 @@ void HomeMovementGenerator::_setTargetLocation(Creature& owner) owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_EVADE | UNIT_STATE_IGNORE_PATHFINDING)); } -bool HomeMovementGenerator::Update(Creature& owner, const uint32& time_diff) +bool HomeMovementGenerator::Update(Creature& owner, const uint32& /*time_diff*/) { arrived = skipToHome || owner.movespline->Finalized(); return !arrived; diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index ad3e96d3f..19c2fa18b 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -1210,7 +1210,7 @@ bool ChatHandler::HandleReloadAuctionsCommand(const char* /*args*/) return true; } -bool ChatHandler::HandleReloadConditions(const char* args) +bool ChatHandler::HandleReloadConditions(const char* /*args*/) { sLog.outString("Re-Loading Conditions..."); sConditionMgr.LoadConditions(true); diff --git a/src/game/Level4.cpp b/src/game/Level4.cpp index 8925d6ffb..37f3e1925 100644 --- a/src/game/Level4.cpp +++ b/src/game/Level4.cpp @@ -93,7 +93,7 @@ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::s { // search by GUID if (isNumeric(searchString.c_str())) - resultChar = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND guid = %llu", uint64(atoi(searchString.c_str()))); + resultChar = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND guid = " UI64FMTD, uint64(atoi(searchString.c_str()))); // search by name else { diff --git a/src/game/MapInstanced.h b/src/game/MapInstanced.h index 295eed26c..4b9c327cb 100644 --- a/src/game/MapInstanced.h +++ b/src/game/MapInstanced.h @@ -31,10 +31,10 @@ class MapInstanced : public Map ~MapInstanced() {} // functions overwrite Map versions - void Update(const uint32&); - void DelayedUpdate(const uint32 diff); + void Update(const uint32&) override; + void DelayedUpdate(const uint32 diff) override; //void RelocationNotify(); - void UnloadAll(); + void UnloadAll() override; EnterState CannotEnter(Player* /*player*/) override; Map* CreateInstanceForPlayer(const uint32 mapId, Player* player, uint32 loginInstanceId = 0); @@ -62,7 +62,7 @@ class MapInstanced : public Map { return m_InstancedMaps; } - virtual void InitVisibilityDistance(); + void InitVisibilityDistance() override; private: diff --git a/src/game/MapUpdater.h b/src/game/MapUpdater.h index 2da47fbf6..663c4c789 100644 --- a/src/game/MapUpdater.h +++ b/src/game/MapUpdater.h @@ -47,8 +47,8 @@ class MapUpdater private: DelayExecutor m_executor; - ACE_Condition_Thread_Mutex m_condition; ACE_Thread_Mutex m_mutex; + ACE_Condition_Thread_Mutex m_condition; size_t pending_requests; void update_finished(); diff --git a/src/game/MovementGenerator.h b/src/game/MovementGenerator.h index 35c0f7c3b..d3823099d 100644 --- a/src/game/MovementGenerator.h +++ b/src/game/MovementGenerator.h @@ -57,22 +57,22 @@ template class MovementGeneratorMedium : public MovementGenerator { public: - void Initialize(Unit& u) + void Initialize(Unit& u) override { //u->AssertIsType(); (static_cast(this))->Initialize(*((T*)&u)); } - void Finalize(Unit& u) + void Finalize(Unit& u) override { //u->AssertIsType(); (static_cast(this))->Finalize(*((T*)&u)); } - void Reset(Unit& u) + void Reset(Unit& u) override { //u->AssertIsType(); (static_cast(this))->Reset(*((T*)&u)); } - bool Update(Unit& u, const uint32& time_diff) + bool Update(Unit& u, const uint32& time_diff) override { //u->AssertIsType(); return (static_cast(this))->Update(*((T*)&u), time_diff); diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 37ea247ad..df7f2597c 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -2119,7 +2119,7 @@ TempSummon* WorldObject::SummonCreature(uint32 entry, const Position& pos, TempS { if (Map* map = FindMap()) { - if (TempSummon* summon = map->SummonCreature(entry, pos, NULL, duration, isType(TYPEMASK_UNIT) ? (Unit*)this : NULL, NULL, spwtype)) + if (TempSummon* summon = map->SummonCreature(entry, pos, NULL, duration, isType(TYPEMASK_UNIT) ? (Unit*)this : NULL, 0, spwtype)) return summon; } diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 6737175e8..065851a68 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -472,7 +472,7 @@ void ObjectMgr::LoadCreatureLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.Name.size() <= idx) + if (data.Name.size() <= uint32(idx)) data.Name.resize(idx + 1); data.Name[idx] = str; @@ -484,7 +484,7 @@ void ObjectMgr::LoadCreatureLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.SubName.size() <= idx) + if (data.SubName.size() <= uint32(idx)) data.SubName.resize(idx + 1); data.SubName[idx] = str; @@ -531,7 +531,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.OptionText.size() <= idx) + if (data.OptionText.size() <= uint32(idx)) data.OptionText.resize(idx + 1); data.OptionText[idx] = str; @@ -543,7 +543,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.BoxText.size() <= idx) + if (data.BoxText.size() <= uint32(idx)) data.BoxText.resize(idx + 1); data.BoxText[idx] = str; @@ -553,7 +553,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() } while (result->NextRow()); - sLog.outString(">> Loaded %u gossip_menu_option locale strings", mGossipMenuItemsLocaleMap.size()); + sLog.outString(">> Loaded %lu gossip_menu_option locale strings", mGossipMenuItemsLocaleMap.size()); } void ObjectMgr::LoadPointOfInterestLocales() @@ -586,7 +586,7 @@ void ObjectMgr::LoadPointOfInterestLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.IconName.size() <= idx) + if (data.IconName.size() <= uint32(idx)) data.IconName.resize(idx + 1); data.IconName[idx] = str; @@ -594,7 +594,7 @@ void ObjectMgr::LoadPointOfInterestLocales() } } while (result->NextRow()); - sLog.outString(">> Loaded %u points_of_interest locale strings", mPointOfInterestLocaleMap.size()); + sLog.outString(">> Loaded %lu points_of_interest locale strings", mPointOfInterestLocaleMap.size()); } struct SQLCreatureLoader : public SQLStorageLoaderBase @@ -1852,7 +1852,7 @@ void ObjectMgr::LoadItemLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.Name.size() <= idx) + if (data.Name.size() <= uint32(idx)) data.Name.resize(idx + 1); data.Name[idx] = str; @@ -1865,7 +1865,7 @@ void ObjectMgr::LoadItemLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.Description.size() <= idx) + if (data.Description.size() <= uint32(idx)) data.Description.resize(idx + 1); data.Description[idx] = str; @@ -3829,7 +3829,7 @@ void ObjectMgr::LoadQuests() } } - sLog.outString(">> Loaded %u quest definitions", mQuestTemplates.size()); + sLog.outString(">> Loaded %lu quest definitions", mQuestTemplates.size()); } void ObjectMgr::LoadQuestLocales() @@ -3873,7 +3873,7 @@ void ObjectMgr::LoadQuestLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.Title.size() <= idx) + if (data.Title.size() <= uint32(idx)) data.Title.resize(idx + 1); data.Title[idx] = str; @@ -3885,7 +3885,7 @@ void ObjectMgr::LoadQuestLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.Details.size() <= idx) + if (data.Details.size() <= uint32(idx)) data.Details.resize(idx + 1); data.Details[idx] = str; @@ -3897,7 +3897,7 @@ void ObjectMgr::LoadQuestLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.Objectives.size() <= idx) + if (data.Objectives.size() <= uint32(idx)) data.Objectives.resize(idx + 1); data.Objectives[idx] = str; @@ -3909,7 +3909,7 @@ void ObjectMgr::LoadQuestLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.OfferRewardText.size() <= idx) + if (data.OfferRewardText.size() <= uint32(idx)) data.OfferRewardText.resize(idx + 1); data.OfferRewardText[idx] = str; @@ -3921,7 +3921,7 @@ void ObjectMgr::LoadQuestLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.RequestItemsText.size() <= idx) + if (data.RequestItemsText.size() <= uint32(idx)) data.RequestItemsText.resize(idx + 1); data.RequestItemsText[idx] = str; @@ -3933,7 +3933,7 @@ void ObjectMgr::LoadQuestLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.EndText.size() <= idx) + if (data.EndText.size() <= uint32(idx)) data.EndText.resize(idx + 1); data.EndText[idx] = str; @@ -3947,7 +3947,7 @@ void ObjectMgr::LoadQuestLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.ObjectiveText[k].size() <= idx) + if (data.ObjectiveText[k].size() <= uint32(idx)) data.ObjectiveText[k].resize(idx + 1); data.ObjectiveText[k][idx] = str; @@ -3958,7 +3958,7 @@ void ObjectMgr::LoadQuestLocales() } while (result->NextRow()); - sLog.outString(">> Loaded %u Quest locale strings", mQuestLocaleMap.size()); + sLog.outString(">> Loaded %lu Quest locale strings", mQuestLocaleMap.size()); } void ObjectMgr::LoadPetCreateSpells() @@ -4595,7 +4595,7 @@ void ObjectMgr::LoadPageTextLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.Text.size() <= idx) + if (data.Text.size() <= uint32(idx)) data.Text.resize(idx + 1); data.Text[idx] = str; @@ -4770,7 +4770,7 @@ void ObjectMgr::LoadNpcTextLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.Text_0[j].size() <= idx) + if (data.Text_0[j].size() <= uint32(idx)) data.Text_0[j].resize(idx + 1); data.Text_0[j][idx] = str0; @@ -4782,7 +4782,7 @@ void ObjectMgr::LoadNpcTextLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.Text_1[j].size() <= idx) + if (data.Text_1[j].size() <= uint32(idx)) data.Text_1[j].resize(idx + 1); data.Text_1[j][idx] = str1; @@ -5247,8 +5247,8 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float // if find graveyard at different map from where entrance placed (or no entrance data), use any first if (!mapEntry || mapEntry->entrance_map < 0 - || mapEntry->entrance_map != entry->map_id - || mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0) + || uint32(mapEntry->entrance_map) != entry->map_id + || (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) { // not have any corrdinates for check distance anyway entryFar = entry; @@ -5805,7 +5805,7 @@ void ObjectMgr::LoadGameObjectLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.Name.size() <= idx) + if (data.Name.size() <= uint32(idx)) data.Name.resize(idx + 1); data.Name[idx] = str; @@ -5821,7 +5821,7 @@ void ObjectMgr::LoadGameObjectLocales() int idx = GetOrNewIndexForLocale(LocaleConstant(i)); if (idx >= 0) { - if (data.CastBarCaption.size() <= idx) + if (data.CastBarCaption.size() <= uint32(idx)) data.CastBarCaption.resize(idx + 1); data.CastBarCaption[idx] = str; @@ -6959,7 +6959,7 @@ bool ObjectMgr::LoadOregonStrings(DatabaseType& db, char const* table, int32 min if (idx >= 0) { // 0 -> default, idx in to idx+1 - if (data.Content.size() <= idx + 1) + if (data.Content.size() <= uint32(idx) + 1) data.Content.resize(idx + 2); data.Content[idx + 1] = str; diff --git a/src/game/PathFinder.cpp b/src/game/PathFinder.cpp index 36996c969..00f355013 100644 --- a/src/game/PathFinder.cpp +++ b/src/game/PathFinder.cpp @@ -59,7 +59,6 @@ bool PathInfo::Update(float destX, float destY, float destZ, bool forceDest) return false; } - Vector3 oldDest = getEndPosition(); Vector3 newDest(destX, destY, destZ); setEndPosition(newDest); diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp index 67d496931..a8bc1b2fa 100644 --- a/src/game/PetAI.cpp +++ b/src/game/PetAI.cpp @@ -226,7 +226,7 @@ void PetAI::UpdateAI(const uint32 diff) } } -void PetAI::DamageDealt(Unit* victim, uint32& damage, DamageEffectType damageType) +void PetAI::DamageDealt(Unit* victim, uint32& /*damage*/, DamageEffectType /*damageType*/) { if (!victim) return; diff --git a/src/game/PetAI.h b/src/game/PetAI.h index 496909740..5f67c30c6 100644 --- a/src/game/PetAI.h +++ b/src/game/PetAI.h @@ -30,34 +30,31 @@ class PetAI : public CreatureAI explicit PetAI(Creature* c); - void UpdateAI(const uint32); + void UpdateAI(const uint32) override; static int Permissible(const Creature*); - void KilledUnit(Unit* victim); - void AttackStart(Unit* target); - void MovementInform(uint32 moveType, uint32 data); - void OwnerAttackedBy(Unit* attacker); - void OwnerAttacked(Unit* target); - void AttackedBy(Unit* attacker); - void DamageDealt(Unit* victim, uint32& damage, DamageEffectType damageType); + void KilledUnit(Unit* victim) override; + void AttackStart(Unit* target) override; + void MovementInform(uint32 moveType, uint32 data) override; + void OwnerAttackedBy(Unit* attacker) override; + void OwnerAttacked(Unit* target) override; + void AttackedBy(Unit* attacker) override; + void DamageDealt(Unit* victim, uint32& damage, DamageEffectType damageType) override; void ClearCharmInfoFlags(); // The following aren't used by the PetAI but need to be defined to override // default CreatureAI functions which interfere with the PetAI // - void MoveInLineOfSight(Unit* who) {} // CreatureAI interferes with returning pets - void MoveInLineOfSight_Safe(Unit* who) {} // CreatureAI interferes with returning pets - void EnterEvadeMode() {} // For fleeing, pets don't use this type of Evade mechanic + void MoveInLineOfSight(Unit* /*who*/) override {} // CreatureAI interferes with returning pets + void EnterEvadeMode() override {} // For fleeing, pets don't use this type of Evade mechanic private: - bool _isVisible(Unit*) const; - bool _needToStop(void) const; - void _stopAttack(void); + bool _needToStop() const; + void _stopAttack(); void UpdateAllies(); TimeTracker i_tracker; - bool inCombat; std::set m_AllySet; uint32 m_updateAlliesTimer; diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 3c8b0bc71..f89cedd79 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -354,7 +354,7 @@ void WorldSession::HandlePetStopAttack(WorldPacket& recv_data) if (GetPlayer()->GetGUID() != pet->GetCharmerOrOwnerGUID()) { - sLog.outError("HandlePetStopAttack: %s isn't charm/pet of %s.", petGuid.GetString().c_str(), _player->GetGUIDLow()); + sLog.outError("HandlePetStopAttack: %s isn't charm/pet of %u.", petGuid.GetString().c_str(), _player->GetGUIDLow()); return; } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 30c2fff24..49f25b6e2 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2159,7 +2159,7 @@ Creature* Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask) return creature; } -GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes type) const +GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes /*type*/) const { if (!guid) return nullptr; @@ -15169,7 +15169,7 @@ void Player::_LoadAuras(QueryResult_AutoPtr result, uint32 timediff) } // negative effects should continue counting down after logout - if (remaintime != -1 && !IsPositiveEffect(spellid, effindex) || spellproto->AttributesEx4 & SPELL_ATTR4_EXPIRE_OFFLINE) + if ((remaintime != -1 && !IsPositiveEffect(spellid, effindex)) || spellproto->AttributesEx4 & SPELL_ATTR4_EXPIRE_OFFLINE) { if (remaintime / IN_MILLISECONDS <= int32(timediff)) continue; @@ -20798,7 +20798,7 @@ bool Player::SetCanFly(bool apply, bool packetOnly /*= false*/) return true; } -bool Player::SetLevitate(bool apply, bool /*packetOnly = false*/) +bool Player::SetLevitate(bool /*apply*/, bool /*packetOnly = false*/) { // TODO: check if there is something similar for 2.4.3. // WorldPacket data; diff --git a/src/game/PoolMgr.h b/src/game/PoolMgr.h index 341a2ed4c..2ed4fdd90 100644 --- a/src/game/PoolMgr.h +++ b/src/game/PoolMgr.h @@ -77,7 +77,7 @@ class PoolGroup void AddEntry(PoolObject& poolitem, uint32 maxentries); bool CheckPool() const; PoolObject* RollOne(ActivePoolData& spawns, uint32 triggerFrom); - void DespawnObject(ActivePoolData& spawns, uint32 guid = 0);; + void DespawnObject(ActivePoolData& spawns, uint32 guid = 0); void Despawn1Object(uint32 guid); void SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 triggerFrom); diff --git a/src/game/ScriptMgr.h b/src/game/ScriptMgr.h index 8b085ae05..dbc7855b9 100644 --- a/src/game/ScriptMgr.h +++ b/src/game/ScriptMgr.h @@ -47,58 +47,49 @@ struct ItemTemplate; struct Script { - Script() : - OnLogin(NULL), OnLogout(NULL), OnPVPKill(NULL), OnCreatureKill(NULL), OnPlayerKilledByCreature(NULL), - OnLevelChanged(NULL), OnTalentsReset(NULL), OnGroupCreated(NULL), OnGroupPlayerInvited(NULL), OnGroupPlayerJoined(NULL), - OnGroupPlayerRemoved(NULL), OnGroupLeaderChanged(NULL), OnGroupDisbanded(NULL), - pGossipHello(NULL), QuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL), - pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), - pChooseReward(NULL), pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), OnQuestAccept(NULL), - pGOQuestAccept(NULL), pGOChooseReward(NULL), pGOSelect(NULL), pGOSelectWithCode(NULL), pItemUse(NULL), pEffectDummyCreature(NULL), - GetAI(NULL), GetInstanceData(NULL) - {} + Script() = default; std::string Name; //Methods to be scripted // Player Related - void (*OnLogin )(Player*); - void (*OnLogout )(Player*); - void (*OnPVPKill )(Player*, Player*); - void (*OnCreatureKill )(Player*, Creature*); - void (*OnPlayerKilledByCreature)(Creature*, Player*); - void (*OnLevelChanged )(Player*, uint8, uint8); - void (*OnTalentsReset )(Player*, bool); - - void (*OnGroupCreated )(Group*, Player*); - void (*OnGroupPlayerInvited )(Group*, Player*); - void (*OnGroupPlayerJoined )(Group*, Player*); - void (*OnGroupPlayerRemoved )(Group*, Player*, uint8, uint64, const char*); - void (*OnGroupLeaderChanged )(Group*, Player*, Player*); - void (*OnGroupDisbanded )(Group*, Player*); - - bool (*pGossipHello )(Player*, Creature*); - bool (*QuestAccept )(Player*, Creature*, Quest const*); - bool (*pGossipSelect )(Player*, Creature*, uint32 , uint32); - bool (*pGossipSelectWithCode)(Player*, Creature*, uint32 , uint32 , const char*); - bool (*pGOSelect )(Player*, GameObject*, uint32 , uint32); - bool (*pGOSelectWithCode )(Player*, GameObject*, uint32 , uint32 , const char*); - bool (*pQuestSelect )(Player*, Creature*, Quest const*); - bool (*pQuestComplete )(Player*, Creature*, Quest const*); - uint32 (*pNPCDialogStatus )(Player*, Creature*); - uint32 (*pGODialogStatus )(Player*, GameObject* _GO); - bool (*pChooseReward )(Player*, Creature*, Quest const*, uint32); - bool (*pItemHello )(Player*, Item*, Quest const*); - bool (*pGOHello )(Player*, GameObject*); - bool (*pAreaTrigger )(Player*, AreaTriggerEntry const*); - bool (*OnQuestAccept )(Player*, Item*, Quest const*); - bool (*pGOQuestAccept )(Player*, GameObject*, Quest const*); - bool (*pGOChooseReward )(Player*, GameObject*, Quest const*, uint32); - bool (*pItemUse )(Player*, Item*, SpellCastTargets const&); - bool (*pEffectDummyCreature )(Unit*, uint32, uint32, Creature*); - - CreatureAI* (*GetAI)(Creature*); - InstanceData* (*GetInstanceData)(Map*); + void (*OnLogin )(Player*) = nullptr; + void (*OnLogout )(Player*) = nullptr; + void (*OnPVPKill )(Player*, Player*) = nullptr; + void (*OnCreatureKill )(Player*, Creature*) = nullptr; + void (*OnPlayerKilledByCreature)(Creature*, Player*) = nullptr; + void (*OnLevelChanged )(Player*, uint8, uint8) = nullptr; + void (*OnTalentsReset )(Player*, bool) = nullptr; + + void (*OnGroupCreated )(Group*, Player*) = nullptr; + void (*OnGroupPlayerInvited )(Group*, Player*) = nullptr; + void (*OnGroupPlayerJoined )(Group*, Player*) = nullptr; + void (*OnGroupPlayerRemoved )(Group*, Player*, uint8, uint64, const char*) = nullptr; + void (*OnGroupLeaderChanged )(Group*, Player*, Player*) = nullptr; + void (*OnGroupDisbanded )(Group*, Player*) = nullptr; + + bool (*pGossipHello )(Player*, Creature*) = nullptr; + bool (*QuestAccept )(Player*, Creature*, Quest const*) = nullptr; + bool (*pGossipSelect )(Player*, Creature*, uint32 , uint32) = nullptr; + bool (*pGossipSelectWithCode)(Player*, Creature*, uint32 , uint32 , const char*) = nullptr; + bool (*pGOSelect )(Player*, GameObject*, uint32 , uint32) = nullptr; + bool (*pGOSelectWithCode )(Player*, GameObject*, uint32 , uint32 , const char*) = nullptr; + bool (*pQuestSelect )(Player*, Creature*, Quest const*) = nullptr; + bool (*pQuestComplete )(Player*, Creature*, Quest const*) = nullptr; + uint32 (*pNPCDialogStatus )(Player*, Creature*) = nullptr; + uint32 (*pGODialogStatus )(Player*, GameObject* _GO) = nullptr; + bool (*pChooseReward )(Player*, Creature*, Quest const*, uint32) = nullptr; + bool (*pItemHello )(Player*, Item*, Quest const*) = nullptr; + bool (*pGOHello )(Player*, GameObject*) = nullptr; + bool (*pAreaTrigger )(Player*, AreaTriggerEntry const*) = nullptr; + bool (*OnQuestAccept )(Player*, Item*, Quest const*) = nullptr; + bool (*pGOQuestAccept )(Player*, GameObject*, Quest const*) = nullptr; + bool (*pGOChooseReward )(Player*, GameObject*, Quest const*, uint32) = nullptr; + bool (*pItemUse )(Player*, Item*, SpellCastTargets const&) = nullptr; + bool (*pEffectDummyCreature )(Unit*, uint32, uint32, Creature*) = nullptr; + + CreatureAI* (*GetAI)(Creature*) = nullptr; + InstanceData* (*GetInstanceData)(Map*) = nullptr; void RegisterSelf(); }; diff --git a/src/game/ScriptedInstance.h b/src/game/ScriptedInstance.h index ca81cb5e4..2ce4dd84c 100644 --- a/src/game/ScriptedInstance.h +++ b/src/game/ScriptedInstance.h @@ -35,7 +35,7 @@ class ScriptedInstance : public InstanceData ScriptedInstance(Map* pMap) : InstanceData(pMap) {} ~ScriptedInstance() {} - virtual void MovementInform(Creature* creature, uint32 uiType, uint32 uiPointId) { } + virtual void MovementInform(Creature* /*creature*/, uint32 /*uiType*/, uint32 /*uiPointId*/) { } }; #endif diff --git a/src/game/SmartScriptMgr.cpp b/src/game/SmartScriptMgr.cpp index 3ef2944cd..f9714869a 100644 --- a/src/game/SmartScriptMgr.cpp +++ b/src/game/SmartScriptMgr.cpp @@ -1263,7 +1263,6 @@ void SmartAIMgr::LoadHelperStores() { uint32 oldMSTime = getMSTime(); - SpellEntry const* spellInfo = NULL; for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i) { SpellEntry const* spellInfo = sSpellStore.LookupEntry(i); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 2a2b5dc37..0cddda43f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2861,7 +2861,7 @@ void Spell::update(uint32 difftime) (m_spellInfo->Effect[0] != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLINGFAR))) { // always cancel for channeled spells - if (m_spellState == SPELL_STATE_CASTING && !m_spellInfo->AttributesEx5 & SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING) + if (m_spellState == SPELL_STATE_CASTING && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING)) cancel(); // don't cancel for melee, autorepeat, triggered and instant spells else if (!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !m_IsTriggeredSpell && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT)) @@ -4283,7 +4283,7 @@ SpellCastResult Spell::CheckCast(bool strict) // users, so if it's mana we need to check max is >= 1 bool hasPower = int32(target->getPowerType()) == m_spellInfo->EffectMiscValue[i]; - if (!hasPower || + if (!hasPower || (target->getPowerType() == POWER_MANA && target->GetMaxPower(POWER_MANA) == 0)) return SPELL_FAILED_BAD_TARGETS; @@ -4424,7 +4424,7 @@ SpellCastResult Spell::CheckCast(bool strict) switch (SummonProperties->Category) { case SUMMON_CATEGORY_PET: - if (!m_spellInfo->AttributesEx & SPELL_ATTR1_DISMISS_PET && m_caster->GetPetGUID()) + if (!(m_spellInfo->AttributesEx & SPELL_ATTR1_DISMISS_PET) && m_caster->GetPetGUID()) return SPELL_FAILED_ALREADY_HAVE_SUMMON; // intentional missing break, check both GetPetGUID() and GetCharmGUID for SUMMON_CATEGORY_PET case SUMMON_CATEGORY_PUPPET: @@ -4455,7 +4455,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (Pet* pet = m_caster->ToPlayer()->GetPet()) pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID()); } - else if (!m_spellInfo->AttributesEx & SPELL_ATTR1_DISMISS_PET) + else if (!(m_spellInfo->AttributesEx & SPELL_ATTR1_DISMISS_PET)) return SPELL_FAILED_ALREADY_HAVE_SUMMON; } @@ -4636,7 +4636,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_CHARM || m_spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS) { - if (!m_spellInfo->AttributesEx & SPELL_ATTR1_DISMISS_PET && m_caster->GetPetGUID()) + if (!(m_spellInfo->AttributesEx & SPELL_ATTR1_DISMISS_PET) && m_caster->GetPetGUID()) return SPELL_FAILED_ALREADY_HAVE_SUMMON; if (m_caster->GetCharmGUID()) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index df0e555a0..76a28ff53 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3548,7 +3548,7 @@ void Aura::HandleModStealth(bool apply, bool Real) m_target->UpdateObjectVisibility(false); } -void Aura::HandleModStealthLevel(bool apply, bool Real) +void Aura::HandleModStealthLevel(bool apply, bool /*Real*/) { StealthType type = StealthType(GetMiscValue()); @@ -3609,7 +3609,7 @@ void Aura::HandleModInvisibility(bool apply, bool Real) m_target->UpdateObjectVisibility(false); } -void Aura::HandleModStealthDetect(bool apply, bool Real) +void Aura::HandleModStealthDetect(bool apply, bool /*Real*/) { StealthType type = StealthType(GetMiscValue()); @@ -3629,7 +3629,7 @@ void Aura::HandleModStealthDetect(bool apply, bool Real) m_target->UpdateObjectVisibility(false); } -void Aura::HandleModInvisibilityDetect(bool apply, bool Real) +void Aura::HandleModInvisibilityDetect(bool apply, bool /*Real*/) { InvisibilityType type = InvisibilityType(GetMiscValue()); @@ -4768,7 +4768,7 @@ void Aura::HandleModRegen(bool apply, bool /*Real*/) // eating if (m_periodicTimer <= 0) { m_periodicTimer += 5000; - int32 gain = m_target->ModifyHealth(GetModifierValue()); + m_target->ModifyHealth(GetModifierValue()); } } @@ -6779,7 +6779,7 @@ void Aura::HandleAuraReflectSpellSchool(bool apply, bool real) } } -void Aura::HandleAuraCloneCaster(bool apply, bool Real) +void Aura::HandleAuraCloneCaster(bool apply, bool /*Real*/) { if (apply) { diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 87e08f2b5..117064dc3 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5643,16 +5643,13 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) if (!pCaster) return; - Item* mainItem = NULL; - Item* offItem = NULL; - Item* rangedItem = NULL; - if (mainItem = pCaster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) + if (Item* mainItem = pCaster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) unitTarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 0, mainItem->GetProto()->DisplayInfoID); - if (offItem = pCaster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) + if (Item* offItem = pCaster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) unitTarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, offItem->GetProto()->DisplayInfoID); - if (rangedItem = pCaster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED)) + if (Item* rangedItem = pCaster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED)) unitTarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 2, rangedItem->GetProto()->DisplayInfoID); break; @@ -6421,7 +6418,7 @@ void Spell::EffectBlock(SpellEffIndex /*effIndex*/) unitTarget->ToPlayer()->SetCanBlock(true); } -void Spell::EffectMomentMove(SpellEffIndex effIndex) +void Spell::EffectMomentMove(SpellEffIndex /*effIndex*/) { if (unitTarget->IsInFlight()) return; @@ -6429,8 +6426,6 @@ void Spell::EffectMomentMove(SpellEffIndex effIndex) if (!m_targets.HasDst()) return; - float dist = GetSpellRadius(m_spellInfo, effIndex, false); - Position pos = m_targets.m_dstPos; pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetDistance(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()), 0.0f); unitTarget->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), unitTarget == m_caster); diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index db5fb135c..8b4e94064 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -60,7 +60,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } - sLog.outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, spell_count: %u , cast_count: %u, Item: %u, data length = %i", bagIndex, slot, spellCount, castCount, pItem->GetEntry(), recvPacket.size()); + sLog.outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, spell_count: %u , cast_count: %u, Item: %u, data length = %lu", bagIndex, slot, spellCount, castCount, pItem->GetEntry(), recvPacket.size()); ItemTemplate const* proto = pItem->GetProto(); if (!proto) @@ -185,7 +185,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { - sLog.outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i", recvPacket.size()); + sLog.outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %lu", recvPacket.size()); Player* pUser = _player; uint8 bagIndex, slot; diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 0720687f5..1ae48d64f 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1489,7 +1489,7 @@ void SpellMgr::LoadSpellDummyCondition() } while (result->NextRow()); - sLog.outString(">> Loaded %llu spell dummy conditions", result->GetRowCount()); + sLog.outString(">> Loaded %lu spell dummy conditions", result->GetRowCount()); return; } @@ -1875,7 +1875,7 @@ struct SpellRankEntry : (_Left.SpellVisual != _Right.SpellVisual) && (!_Left.SpellVisual || !_Right.SpellVisual) ? _Left.SpellVisual < _Right.SpellVisual : (_Left.ManaCost != _Right.ManaCost) && (!_Left.ManaCost || !_Right.ManaCost) ? _Left.ManaCost < _Right.ManaCost : (_Left.DurationIndex != _Right.DurationIndex) && (!_Left.DurationIndex || !_Right.DurationIndex) ? _Left.DurationIndex < _Right.DurationIndex - : (_Left.RangeIndex != _Right.RangeIndex) && (!_Left.RangeIndex || !_Right.RangeIndex || _Left.RangeIndex == 1 || !_Right.RangeIndex == 1) ? _Left.RangeIndex < _Right.RangeIndex + : (_Left.RangeIndex != _Right.RangeIndex) && (!_Left.RangeIndex || !_Right.RangeIndex || _Left.RangeIndex == 1 || !(_Right.RangeIndex == 1)) ? _Left.RangeIndex < _Right.RangeIndex : _Left.TargetAuraState < _Right.TargetAuraState ); } diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index a964a5f17..587a51ea9 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -436,7 +436,7 @@ void Player::UpdateShieldBlockValue() SetUInt32Value(PLAYER_SHIELD_BLOCK, GetShieldBlockValue()); } -void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) +void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool /*addTotalPct*/, float& minDamage, float& maxDamage) { UnitMods unitMod; diff --git a/src/game/TargetedMovementGenerator.h b/src/game/TargetedMovementGenerator.h index 2924cc640..e5b265bfc 100644 --- a/src/game/TargetedMovementGenerator.h +++ b/src/game/TargetedMovementGenerator.h @@ -41,9 +41,8 @@ class TargetedMovementGeneratorMedium protected: TargetedMovementGeneratorMedium(Unit& target, float offset = 0, float angle = 0) : TargetedMovementGeneratorBase(target), - m_evadeTimer(urand(4000, 8000)), - i_offset(offset), i_angle(angle), - i_recheckDistance(0), i_path(NULL), + i_recheckDistance(0), m_evadeTimer(urand(4000, 8000)), + i_offset(offset), i_angle(angle), i_path(NULL), m_speedChanged(false), i_targetReached(false) { } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 7875e2b32..3e15e7d3a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2108,7 +2108,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe return; // Magic damage, check for resists - if (!spellInfo || (spellInfo->AttributesEx4 & SPELL_ATTR4_IGNORE_RESISTANCES) == 0 && (schoolMask & SPELL_SCHOOL_MASK_MAGIC) && (!binary || damagetype == DOT)) + if (!spellInfo || ((spellInfo->AttributesEx4 & SPELL_ATTR4_IGNORE_RESISTANCES) == 0 && (schoolMask & SPELL_SCHOOL_MASK_MAGIC) && (!binary || damagetype == DOT))) { const float mitigation = victim->CalculateMagicResistanceMitigation(victim, victim->CalculateEffectiveMagicResistance(victim, schoolMask), false); const SpellPartialResistChanceEntry &chances = SPELL_PARTIAL_RESIST_DISTRIBUTION.at(uint32(mitigation * 10000)); @@ -9566,7 +9566,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellEntry const* bySpell, W // can't attack unattackable units or GMs if (target->HasUnitState(UNIT_STATE_UNATTACKABLE) - || target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->IsGameMaster()) + || (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->IsGameMaster())) return false; // visibility checks @@ -9679,7 +9679,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellEntry const* bySpell) c // can't assist unattackable units or GMs if (target->HasUnitState(UNIT_STATE_UNATTACKABLE) - || target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->IsGameMaster()) + || (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->IsGameMaster())) return false; // can't assist invisible diff --git a/src/game/Unit.h b/src/game/Unit.h index b18f4cbac..65010fa07 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1663,7 +1663,7 @@ class Unit : public WorldObject virtual void UpdateMaxHealth() = 0; virtual void UpdateMaxPower(Powers power) = 0; virtual void UpdateAttackPowerAndDamage(bool ranged = false) = 0; - virtual void UpdateDamagePhysical(WeaponAttackType attType);; + virtual void UpdateDamagePhysical(WeaponAttackType attType); float GetTotalAttackPowerValue(WeaponAttackType attType) const; float GetWeaponDamageRange(WeaponAttackType attType , WeaponDamageRange type) const; void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value) { m_weaponDamage[attType][damageRange] = value; } diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 5388218a1..fe64e7ede 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -279,7 +279,7 @@ void FlightPathMovementGenerator::Reset(Player& player) init.Launch(); } -bool FlightPathMovementGenerator::Update(Player& player, const uint32& diff) +bool FlightPathMovementGenerator::Update(Player& player, const uint32& /*diff*/) { uint32 pointId = (uint32)player.movespline->currentPathIdx(); if (pointId > i_currentNode) @@ -338,7 +338,7 @@ void FlightPathMovementGenerator::DoEventIfAny(Player& player, TaxiPathNodeEntry } } -bool FlightPathMovementGenerator::GetResetPosition(Player&, float& x, float& y, float& z, float& o) const +bool FlightPathMovementGenerator::GetResetPosition(Unit&, float& x, float& y, float& z) { const TaxiPathNodeEntry& node = (*i_path)[i_currentNode]; x = node.x; y = node.y; z = node.z; diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h index ff837de27..5db2c8b9e 100644 --- a/src/game/WaypointMovementGenerator.h +++ b/src/game/WaypointMovementGenerator.h @@ -100,11 +100,11 @@ class FlightPathMovementGenerator m_endGridY = 0.0f; m_endMapId = 0; } - void Initialize(Player&); - void Finalize(Player&); - void Reset(Player&); - bool Update(Player&, const uint32&); - MovementGeneratorType GetMovementGeneratorType() + void Initialize(Player&) override; + void Finalize(Player&) override; + void Reset(Player&) override; + bool Update(Player&, const uint32&) override; + MovementGeneratorType GetMovementGeneratorType() override { return FLIGHT_MOTION_TYPE; } @@ -120,7 +120,7 @@ class FlightPathMovementGenerator void SetCurrentNodeAfterTeleport(); void SkipCurrentNode() { ++i_currentNode; } void DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure); - bool GetResetPosition(Player&, float& /*x*/, float& /*y*/, float& /*z*/, float& /*o*/) const; + bool GetResetPosition(Unit&, float& /*x*/, float& /*y*/, float& /*z*/) override; private: // storage for preloading the flightmaster grid at end // before reaching final waypoint diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index e6936eb03..70d364546 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -137,7 +137,7 @@ int WorldSocket::SendPacket (const WorldPacket& pct) // Dump outgoing packet. if (sLog.IsLogTypeEnabled(LOG_TYPE_NETWORK)) { - sLog.outNetwork ("SERVER:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n", + sLog.outNetwork ("SERVER:\nSOCKET: %u\nLENGTH: %lu\nOPCODE: %s (0x%.4X)\nDATA:\n", (uint32) get_handle(), pct.size(), LookupOpcodeName (pct.GetOpcode()), @@ -566,7 +566,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) // Dump received packet. if (sLog.IsLogTypeEnabled(LOG_TYPE_NETWORK)) { - sLog.outNetwork ("CLIENT:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n", + sLog.outNetwork ("CLIENT:\nSOCKET: %u\nLENGTH: %lu\nOPCODE: %s (0x%.4X)\nDATA:\n", (uint32) get_handle(), new_pct->size(), LookupOpcodeName (new_pct->GetOpcode()), diff --git a/src/game/ZoneScript.h b/src/game/ZoneScript.h index b7152b1fe..238acbfeb 100644 --- a/src/game/ZoneScript.h +++ b/src/game/ZoneScript.h @@ -61,8 +61,8 @@ class ZoneScript virtual void SetData(uint32 /*DataId*/, uint32 /*Value*/) {} // These functions are called explicitly by scripting stuff, no regular core-link for them, yet. - virtual void ProcessEvent(GameObject* /*obj*/, uint32 eventId = 0) {} - virtual void ProcessEvent(Unit* /*obj*/, uint32 eventId = 0) {} + virtual void ProcessEvent(GameObject* /*obj*/, uint32 /*eventId*/ = 0) {} + virtual void ProcessEvent(Unit* /*obj*/, uint32 /*eventId*/ = 0) {} }; #endif