diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index c05ab22aa..e09610820 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -325,7 +325,7 @@ bool AchievementCriteriaRequirement::Meets(uint32 criteria_id, Player const* sou case ACHIEVEMENT_CRITERIA_REQUIRE_T_TEAM: if (!target || target->GetTypeId() != TYPEID_PLAYER) return false; - return ((Player*)target)->GetTeam() == team.team; + return ((Player*)target)->GetTeam() == Team(team.team); case ACHIEVEMENT_CRITERIA_REQUIRE_S_DRUNK: return (uint32)Player::GetDrunkenstateByValue(source->GetDrunkValue()) >= drunk.state; case ACHIEVEMENT_CRITERIA_REQUIRE_HOLIDAY: diff --git a/src/game/BattleGroundAV.cpp b/src/game/BattleGroundAV.cpp index a288d58e7..2e528ae20 100644 --- a/src/game/BattleGroundAV.cpp +++ b/src/game/BattleGroundAV.cpp @@ -704,7 +704,7 @@ WorldSafeLocsEntry const* BattleGroundAV::GetClosestGraveYard(Player* plr) return good_entry; } -uint32 BattleGroundAV::GetNodeName(BG_AV_Nodes node) +uint32 BattleGroundAV::GetNodeName(BG_AV_Nodes node) const { switch (node) { diff --git a/src/game/BattleGroundAV.h b/src/game/BattleGroundAV.h index 4bba3691c..31793f615 100644 --- a/src/game/BattleGroundAV.h +++ b/src/game/BattleGroundAV.h @@ -364,9 +364,9 @@ class BattleGroundAV : public BattleGround void PopulateNode(BG_AV_Nodes node); - uint32 GetNodeName(BG_AV_Nodes node); - const bool IsTower(BG_AV_Nodes node) { return (node == BG_AV_NODES_ERROR) ? false : m_Nodes[node].Tower; } - const bool IsGrave(BG_AV_Nodes node) { return (node == BG_AV_NODES_ERROR) ? false : !m_Nodes[node].Tower; } + uint32 GetNodeName(BG_AV_Nodes node) const; + bool IsTower(BG_AV_Nodes node) const { return (node == BG_AV_NODES_ERROR) ? false : m_Nodes[node].Tower; } + bool IsGrave(BG_AV_Nodes node) const { return (node == BG_AV_NODES_ERROR) ? false : !m_Nodes[node].Tower; } /*mine*/ void ChangeMineOwner(uint8 mine, BattleGroundAVTeamIndex teamIdx); diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index 5d03e027c..c26ebd2d8 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -73,7 +73,7 @@ class MANGOS_DLL_SPEC CreatureAI * Use this for on-the-fly debugging * @param reader is a ChatHandler to send messages to. */ - virtual void GetAIInformation(ChatHandler& reader) {} + virtual void GetAIInformation(ChatHandler& /*reader*/) {} ///== Reactions At ================================= @@ -83,13 +83,13 @@ class MANGOS_DLL_SPEC CreatureAI * Note: This function is not called for creatures who are in evade mode * @param pWho Unit* who moved in the visibility range and is visisble */ - virtual void MoveInLineOfSight(Unit* pWho) {} + virtual void MoveInLineOfSight(Unit* /*pWho*/) {} /** * Called for reaction at enter to combat if not in combat yet * @param pEnemy Unit* of whom the Creature enters combat with, can be NULL */ - virtual void EnterCombat(Unit* pEnemy) {} + virtual void EnterCombat(Unit* /*pEnemy*/) {} /** * Called for reaction at stopping attack at no attackers or targets @@ -110,7 +110,7 @@ class MANGOS_DLL_SPEC CreatureAI * @param pDoneTo Unit* to whom Damage of amount uiDamage will be dealt * @param uiDamage Amount of Damage that will be dealt, can be changed here */ - virtual void DamageDeal(Unit* pDoneTo, uint32& uiDamage) {} + virtual void DamageDeal(Unit* /*pDoneTo*/, uint32& /*uiDamage*/) {} /** * Called at any Damage from any attacker (before damage apply) @@ -119,69 +119,69 @@ class MANGOS_DLL_SPEC CreatureAI * @param pDealer Unit* who will deal Damage to the creature * @param uiDamage Amount of Damage that will be dealt, can be changed here */ - virtual void DamageTaken(Unit* pDealer, uint32& uiDamage) {} + virtual void DamageTaken(Unit* /*pDealer*/, uint32& /*uiDamage*/) {} /** * Called when the creature is killed * @param pKiller Unit* who killed the creature */ - virtual void JustDied(Unit* pKiller) {} + virtual void JustDied(Unit* /*pKiller*/) {} /** * Called when the corpse of this creature gets removed * @param uiRespawnDelay Delay (in seconds). If != 0, then this is the time after which the creature will respawn, if = 0 the default respawn-delay will be used */ - virtual void CorpseRemoved(uint32& uiRespawnDelay) {} + virtual void CorpseRemoved(uint32& /*uiRespawnDelay*/) {} /** * Called when a summoned creature is killed * @param pSummoned Summoned Creature* that got killed */ - virtual void SummonedCreatureJustDied(Creature* pSummoned) {} + virtual void SummonedCreatureJustDied(Creature* /*pSummoned*/) {} /** * Called when the creature kills a unit * @param pVictim Victim that got killed */ - virtual void KilledUnit(Unit* pVictim) {} + virtual void KilledUnit(Unit* /*pVictim*/) {} /** * Called when owner of m_creature (if m_creature is PROTECTOR_PET) kills a unit * @param pVictim Victim that got killed (by owner of creature) */ - virtual void OwnerKilledUnit(Unit* pVictim) {} + virtual void OwnerKilledUnit(Unit* /*pVictim*/) {} /** * Called when the creature summon successfully other creature * @param pSummoned Creature that got summoned */ - virtual void JustSummoned(Creature* pSummoned) {} + virtual void JustSummoned(Creature* /*pSummoned*/) {} /** * Called when the creature summon successfully a gameobject * @param pGo GameObject that was summoned */ - virtual void JustSummoned(GameObject* pGo) {} + virtual void JustSummoned(GameObject* /*pGo*/) {} /** * Called when a summoned creature gets TemporarySummon::UnSummon ed * @param pSummoned Summoned creature that despawned */ - virtual void SummonedCreatureDespawn(Creature* pSummoned) {} + virtual void SummonedCreatureDespawn(Creature* /*pSummoned*/) {} /** * Called when hit by a spell * @param pCaster Caster who casted the spell * @param pSpell The spell that hit the creature */ - virtual void SpellHit(Unit* pCaster, const SpellEntry* pSpell) {} + virtual void SpellHit(Unit* /*pCaster*/, const SpellEntry* /*pSpell*/) {} /** * Called when spell hits creature's target * @param pTarget Target that we hit with the spell * @param pSpell Spell with which we hit pTarget */ - virtual void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) {} + virtual void SpellHitTarget(Unit* /*pTarget*/, const SpellEntry* /*pSpell*/) {} /** * Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc) @@ -199,7 +199,7 @@ class MANGOS_DLL_SPEC CreatureAI * @param uiMovementType Type of the movement (enum MovementGeneratorType) * @param uiData Data related to the finished movement (ie point-id) */ - virtual void MovementInform(uint32 uiMovementType, uint32 uiData) {} + virtual void MovementInform(uint32 /*uiMovementType*/, uint32 /*uiData*/) {} /** * Called if a temporary summoned of m_creature reach a move point @@ -207,14 +207,14 @@ class MANGOS_DLL_SPEC CreatureAI * @param uiMotionType Type of the movement (enum MovementGeneratorType) * @param uiData Data related to the finished movement (ie point-id) */ - virtual void SummonedMovementInform(Creature* pSummoned, uint32 uiMotionType, uint32 uiData) {} + virtual void SummonedMovementInform(Creature* /*pSummoned*/, uint32 /*uiMotionType*/, uint32 /*uiData*/) {} /** * Called at text emote receive from player * @param pPlayer Player* who sent the emote * @param uiEmote ID of the emote the player used with the creature as target */ - virtual void ReceiveEmote(Player* pPlayer, uint32 uiEmote) {} + virtual void ReceiveEmote(Player* /*pPlayer*/, uint32 /*uiEmote*/) {} ///== Triggered Actions Requested ================== @@ -224,7 +224,7 @@ class MANGOS_DLL_SPEC CreatureAI * Note: Usually called by MoveInLineOfSight, in Unit::SelectHostileTarget or when the AI is forced to attack an enemy * @param pWho Unit* who is possible target */ - virtual void AttackStart(Unit* pWho) {} + virtual void AttackStart(Unit* /*pWho*/) {} /** * Called at World update tick, by default every 100ms @@ -232,7 +232,7 @@ class MANGOS_DLL_SPEC CreatureAI * Note: Use this function to handle Timers, Threat-Management and MeleeAttacking * @param uiDiff Passed time since last call */ - virtual void UpdateAI(const uint32 uiDiff) {} + virtual void UpdateAI(const uint32 /*uiDiff*/) {} ///== State checks ================================= @@ -241,7 +241,7 @@ class MANGOS_DLL_SPEC CreatureAI * Note: This check is by default only the state-depending (visibility, range), NOT LineOfSight * @param pWho Unit* who is checked if it is visisble for the creature */ - virtual bool IsVisible(Unit* pWho) const { return false; } + virtual bool IsVisible(Unit* /*pWho*/) const { return false; } // Called when victim entered water and creature can not enter water // TODO: rather unused diff --git a/src/game/CreatureLinkingMgr.cpp b/src/game/CreatureLinkingMgr.cpp index 7b69b8bc9..ff3327e69 100644 --- a/src/game/CreatureLinkingMgr.cpp +++ b/src/game/CreatureLinkingMgr.cpp @@ -471,6 +471,9 @@ void CreatureLinkingHolder::DoCreatureLinkingEvent(CreatureLinkingEvent eventTyp case LINKING_EVENT_RESPAWN: if (pMaster->isAlive()) SetFollowing(pSource, pMaster); + break; + case LINKING_EVENT_DIE: // Nothing linked for this case + break; } } } diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index 2b206a310..8280ec500 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -115,7 +115,7 @@ Unit* DynamicObject::GetCaster() const return ObjectAccessor::GetUnit(*this, GetCasterGuid()); } -void DynamicObject::Update(uint32 update_diff, uint32 p_time) +void DynamicObject::Update(uint32 /*update_diff*/, uint32 p_time) { // caster can be not in world at time dynamic object update, but dynamic object not yet deleted in Unit destructor Unit* caster = GetCaster(); diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index 03dc1487e..b2685c626 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -41,7 +41,7 @@ namespace MaNGOS explicit VisibleNotifier(Camera& c) : i_camera(c), i_clientGUIDs(c.GetOwner()->m_clientGUIDs) {} template void Visit(GridRefManager& m); - void Visit(CameraMapType& m) {} + void Visit(CameraMapType& /*m*/) {} void Notify(void); }; @@ -704,7 +704,7 @@ namespace MaNGOS { public: NearestGameObjectEntryInPosRangeCheck(WorldObject const& obj, uint32 entry, float x, float y, float z, float range) - : i_obj(obj), i_x(x), i_y(y), i_z(z), i_entry(entry), i_range(range) {} + : i_obj(obj), i_entry(entry), i_x(x), i_y(y), i_z(z), i_range(range) {} WorldObject const& GetFocusObject() const { return i_obj; } @@ -737,7 +737,7 @@ namespace MaNGOS { public: GameObjectEntryInPosRangeCheck(WorldObject const& obj, uint32 entry, float x, float y, float z, float range) - : i_obj(obj), i_x(x), i_y(y), i_z(z), i_entry(entry), i_range(range) {} + : i_obj(obj), i_entry(entry), i_x(x), i_y(y), i_z(z), i_range(range) {} WorldObject const& GetFocusObject() const { return i_obj; } @@ -1096,7 +1096,7 @@ namespace MaNGOS WorldObject const& GetFocusObject() const { return i_obj; } bool operator()(Creature* u) { - if (u->GetEntry() == i_entry && (i_onlyAlive && u->isAlive() || i_onlyDead && u->IsCorpse() || !i_onlyAlive && !i_onlyDead) && i_obj.IsWithinDistInMap(u, i_range)) + if (u->GetEntry() == i_entry && ((i_onlyAlive && u->isAlive()) || (i_onlyDead && u->IsCorpse()) || (!i_onlyAlive && !i_onlyDead)) && i_obj.IsWithinDistInMap(u, i_range)) { i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check return true; diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp index dd2ee6b36..2e665ddae 100644 --- a/src/game/Guild.cpp +++ b/src/game/Guild.cpp @@ -204,6 +204,7 @@ bool Guild::AddMember(ObjectGuid plGuid, uint32 plRank) newmember.ZoneId = fields[3].GetUInt32(); newmember.accountId = fields[4].GetInt32(); delete result; + if (newmember.Level < 1 || newmember.Level > STRONG_MAX_LEVEL || !((1 << (newmember.Class - 1)) & CLASSMASK_ALL_PLAYABLE)) { diff --git a/src/game/LFGHandler.cpp b/src/game/LFGHandler.cpp index a11425a06..e83e6d88d 100644 --- a/src/game/LFGHandler.cpp +++ b/src/game/LFGHandler.cpp @@ -68,7 +68,7 @@ void WorldSession::HandleSearchLfgJoinOpcode(WorldPacket& recv_data) recv_data >> temp; entry = (temp & 0x00FFFFFF); - LfgType type = LfgType((temp >> 24) & 0x000000FF); + // LfgType type = LfgType((temp >> 24) & 0x000000FF); //SendLfgSearchResults(type, entry); } diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 1f627ba7b..d5dbed6d0 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -4711,7 +4711,7 @@ bool ChatHandler::HandleLookupPoolCommand(char* args) return true; } -bool ChatHandler::HandlePoolListCommand(char* args) +bool ChatHandler::HandlePoolListCommand(char* /*args*/) { Player* player = m_session->GetPlayer(); diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index e5e2be5be..5023d7251 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -144,7 +144,7 @@ bool ChatHandler::HandleAHBotRebuildCommand(char* args) return true; } -bool ChatHandler::HandleAHBotReloadCommand(char* args) +bool ChatHandler::HandleAHBotReloadCommand(char* /*args*/) { if (sAuctionBot.ReloadAllConfig()) { @@ -6384,7 +6384,7 @@ ComeToMe command REQUIRED for 3rd party scripting library to have access to Poin Without this function 3rd party scripting library will get linking errors (unresolved external) when attempting to use the PointMovementGenerator */ -bool ChatHandler::HandleComeToMeCommand(char* args) +bool ChatHandler::HandleComeToMeCommand(char* /*args*/) { Creature* caster = getSelectedCreature(); diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index 9ed6ecf8c..217c63591 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -404,17 +404,17 @@ LootSlotType LootItem::GetSlotTypeForSharedLoot(PermissionTypes permission, Play switch (permission) { - case GROUP_PERMISSION: - return (is_blocked || is_underthreshold) ? LOOT_SLOT_NORMAL : LOOT_SLOT_VIEW; case ALL_PERMISSION: return LOOT_SLOT_NORMAL; - case OWNER_PERMISSION: - return LOOT_SLOT_OWNER; + case GROUP_PERMISSION: + return (is_blocked || is_underthreshold) ? LOOT_SLOT_NORMAL : LOOT_SLOT_VIEW; case MASTER_PERMISSION: return !is_underthreshold ? LOOT_SLOT_MASTER : LOOT_SLOT_NORMAL; + case OWNER_PERMISSION: + return LOOT_SLOT_OWNER; + default: + return MAX_LOOT_SLOT_TYPE; } - - return MAX_LOOT_SLOT_TYPE; } // diff --git a/src/game/MapPersistentStateMgr.cpp b/src/game/MapPersistentStateMgr.cpp index af6959c03..2de17283b 100644 --- a/src/game/MapPersistentStateMgr.cpp +++ b/src/game/MapPersistentStateMgr.cpp @@ -291,16 +291,16 @@ void DungeonPersistentState::UpdateEncounterState(EncounterCreditType type, uint { DungeonEncounterEntry const* dbcEntry = iter->second->dbcEntry; - if (iter->second->creditType == type && dbcEntry->Difficulty == GetDifficulty() && dbcEntry->mapId == GetMapId()) + if (iter->second->creditType == type && Difficulty(dbcEntry->Difficulty) == GetDifficulty() && dbcEntry->mapId == GetMapId()) { m_completedEncountersMask |= 1 << dbcEntry->encounterIndex; CharacterDatabase.PExecute("UPDATE instance SET encountersMask = '%u' WHERE id = '%u'", m_completedEncountersMask, GetInstanceId()); DEBUG_LOG("DungeonPersistentState: Dungeon %s (Id %u) completed encounter %s", GetMap()->GetMapName(), GetInstanceId(), dbcEntry->encounterName[sWorld.GetDefaultDbcLocale()]); - if (uint32 dungeonId = iter->second->lastEncounterDungeon) + if (/*uint32 dungeonId =*/ iter->second->lastEncounterDungeon) { - DEBUG_LOG("DungeonPersistentState:: Dungeon %s (Id %u) completed last encounter %s", GetMap()->GetMapName(), GetInstanceId(), dbcEntry->encounterName[sWorld.GetDefaultDbcLocale()]); + DEBUG_LOG("DungeonPersistentState:: Dungeon %s (Instance-Id %u) completed last encounter %s", GetMap()->GetMapName(), GetInstanceId(), dbcEntry->encounterName[sWorld.GetDefaultDbcLocale()]); // Place LFG reward here } return; @@ -483,7 +483,7 @@ void DungeonResetScheduler::LoadResetTimes() // schedule the global reset/warning ResetEventType type = RESET_EVENT_INFORM_1; for (; type < RESET_EVENT_INFORM_LAST; type = ResetEventType(type + 1)) - if (t - resetEventTypeDelay[type] > now) + if (t > time_t(now + resetEventTypeDelay[type])) break; ScheduleReset(true, t - resetEventTypeDelay[type], DungeonResetEvent(type, mapid, difficulty, 0)); @@ -563,7 +563,7 @@ void DungeonResetScheduler::Update() ResetEventType type = RESET_EVENT_INFORM_1; for (; type < RESET_EVENT_INFORM_LAST; type = ResetEventType(type + 1)) - if (next_reset - resetEventTypeDelay[type] > now) + if (next_reset > time_t(now + resetEventTypeDelay[type])) break; // add new scheduler event to the queue @@ -618,7 +618,7 @@ MapPersistentState* MapPersistentStateManager::AddPersistentState(MapEntry const } } - DEBUG_LOG("MapPersistentStateManager::AddPersistentState: mapid = %d, instanceid = %d, reset time = %u, canRset = %u", mapEntry->MapID, instanceId, resetTime, canReset ? 1 : 0); + DEBUG_LOG("MapPersistentStateManager::AddPersistentState: mapid = %d, instanceid = %d, reset time = '" UI64FMTD "', canRset = %u", mapEntry->MapID, instanceId, uint64(resetTime), canReset ? 1 : 0); MapPersistentState* state; if (mapEntry->IsDungeon()) diff --git a/src/game/Object.h b/src/game/Object.h index be81cf9a9..7b4039ae2 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -591,7 +591,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object // ASSERT print helper bool PrintCoordinatesError(float x, float y, float z, char const* descr) const; - virtual void StartGroupLoot(Group* group, uint32 timer) {} + virtual void StartGroupLoot(Group* /*group*/, uint32 /*timer*/) {} protected: explicit WorldObject(); diff --git a/src/game/ObjectGridLoader.cpp b/src/game/ObjectGridLoader.cpp index 5dbe1185d..f71c56a42 100644 --- a/src/game/ObjectGridLoader.cpp +++ b/src/game/ObjectGridLoader.cpp @@ -107,7 +107,7 @@ template<> void addUnitState(Creature* obj, CellPair const& cell_pair) } template -void LoadHelper(CellGuidSet const& guid_set, CellPair& cell, GridRefManager& m, uint32& count, Map* map, GridType& grid) +void LoadHelper(CellGuidSet const& guid_set, CellPair& cell, GridRefManager& /*m*/, uint32& count, Map* map, GridType& grid) { BattleGround* bg = map->IsBattleGroundOrArena() ? ((BattleGroundMap*)map)->GetBG() : NULL; @@ -140,7 +140,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellPair& cell, GridRefManager& } } -void LoadHelper(CellCorpseSet const& cell_corpses, CellPair& cell, CorpseMapType& m, uint32& count, Map* map, GridType& grid) +void LoadHelper(CellCorpseSet const& cell_corpses, CellPair& cell, CorpseMapType& /*m*/, uint32& count, Map* map, GridType& grid) { if (cell_corpses.empty()) return; diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 8823aadb2..66eec11a7 100755 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -5471,7 +5471,7 @@ void ObjectMgr::SetGraveYardLinkTeam(uint32 id, uint32 zoneId, Team team) return; // Link expected but not exist. - sLog.outErrorDb("ObjectMgr::SetGraveYardLinkTeam called for safeLoc %u, zoneId &u, but no graveyard link for this found in database.", id, zoneId); + sLog.outErrorDb("ObjectMgr::SetGraveYardLinkTeam called for safeLoc %u, zoneId %u, but no graveyard link for this found in database.", id, zoneId); AddGraveYardLink(id, zoneId, team); // Add to prevent further error message and correct mechanismn } diff --git a/src/game/PoolManager.h b/src/game/PoolManager.h index 145bf1c5d..3585aef91 100644 --- a/src/game/PoolManager.h +++ b/src/game/PoolManager.h @@ -42,7 +42,7 @@ struct PoolTemplateData // helpers bool CanBeSpawnedAtMap(MapEntry const* entry) const { - return mapEntry && (mapEntry == entry || !entry->Instanceable() && !mapEntry->Instanceable()); + return mapEntry && (mapEntry == entry || (!entry->Instanceable() && !mapEntry->Instanceable())); } }; diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp index 535fbad9e..fb06cea71 100644 --- a/src/game/ScriptMgr.cpp +++ b/src/game/ScriptMgr.cpp @@ -44,6 +44,7 @@ INSTANTIATE_SINGLETON_1(ScriptMgr); ScriptMgr::ScriptMgr() : m_hScriptLib(NULL), + m_scheduledScripts(0), m_pOnInitScriptLibrary(NULL), m_pOnFreeScriptLibrary(NULL), @@ -72,9 +73,7 @@ ScriptMgr::ScriptMgr() : m_pOnEffectDummyCreature(NULL), m_pOnEffectDummyGO(NULL), m_pOnEffectDummyItem(NULL), - m_pOnAuraDummy(NULL), - - m_scheduledScripts(0) + m_pOnAuraDummy(NULL) { } @@ -599,7 +598,7 @@ void ScriptMgr::LoadScripts(ScriptMapMapName& scripts, const char* tablename) if (SpellEntry const* spell = sSpellStore.LookupEntry(i)) for (int j = 0; j < MAX_EFFECT_INDEX; ++j) { - if (spell->Effect[j] == SPELL_EFFECT_SEND_TAXI && spell->EffectMiscValue[j] == tmp.sendTaxiPath.taxiPathId) + if (spell->Effect[j] == SPELL_EFFECT_SEND_TAXI && spell->EffectMiscValue[j] == int32(tmp.sendTaxiPath.taxiPathId)) { taxiSpell = i; break; @@ -1121,7 +1120,7 @@ void ScriptAction::HandleScriptStep() break; // Just turn around - if (m_script->x == 0.0f && m_script->y == 0.0f && m_script->z == 0.0f || + if ((m_script->x == 0.0f && m_script->y == 0.0f && m_script->z == 0.0f) || // Check point-to-point distance, hence revert effect of bounding radius ((Unit*)pSource)->IsWithinDist3d(m_script->x, m_script->y, m_script->z, 0.01f - ((Unit*)pSource)->GetObjectBoundingRadius())) { @@ -1351,8 +1350,8 @@ void ScriptAction::HandleScriptStep() break; } - if (m_script->command == SCRIPT_COMMAND_OPEN_DOOR && pDoor->GetGoState() != GO_STATE_READY || - m_script->command == SCRIPT_COMMAND_CLOSE_DOOR && pDoor->GetGoState() == GO_STATE_READY) + if ((m_script->command == SCRIPT_COMMAND_OPEN_DOOR && pDoor->GetGoState() != GO_STATE_READY) || + (m_script->command == SCRIPT_COMMAND_CLOSE_DOOR && pDoor->GetGoState() == GO_STATE_READY)) break; // to be opened door already open, or to be closed door already closed pDoor->UseDoorOrButton(time_to_reset); diff --git a/src/game/ScriptMgr.h b/src/game/ScriptMgr.h index 9ecffb818..3fed156c1 100644 --- a/src/game/ScriptMgr.h +++ b/src/game/ScriptMgr.h @@ -368,12 +368,12 @@ class ScriptAction void HandleScriptStep(); private: + const char* m_table; // of which table the script was started + Map* m_map; // Map on which the action will be executed ObjectGuid m_sourceGuid; ObjectGuid m_targetGuid; ObjectGuid m_ownerGuid; // owner of source if source is item - const char* m_table; // of which table the script was started ScriptInfo const* m_script; // pointer to static script data - Map* m_map; // Map on which the action will be executed // Helper functions bool GetScriptCommandObject(const ObjectGuid guid, bool includeItem, Object*& resultObject); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index eeea832a6..2cea94e25 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -858,7 +858,7 @@ bool Aura::isAffectedOnSpell(SpellEntry const* spell) const return spell->IsFitToFamily(SpellFamily(GetSpellProto()->SpellFamilyName), GetAuraSpellClassMask()); } -bool Aura::CanProcFrom(SpellEntry const* spell, uint32 procFlag, uint32 EventProcEx, uint32 procEx, bool active, bool useClassMask) const +bool Aura::CanProcFrom(SpellEntry const* spell, uint32 /*procFlag*/, uint32 EventProcEx, uint32 procEx, bool active, bool useClassMask) const { // Check EffectClassMask ClassFamilyMask const& mask = GetAuraSpellClassMask(); @@ -918,7 +918,7 @@ void Aura::ReapplyAffectedPassiveAuras(Unit* target, bool owner_mode) { // permanent passive or permanent area aura // passive spells can be affected only by own or owner spell mods) - if ((itr->second->IsPermanent() && (owner_mode && itr->second->IsPassive() || itr->second->IsAreaAura())) && + if ((itr->second->IsPermanent() && ((owner_mode && itr->second->IsPassive()) || itr->second->IsAreaAura())) && // non deleted and not same aura (any with same spell id) !itr->second->IsDeleted() && itr->second->GetId() != GetId() && // and affected by aura diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 787b4430e..69219df18 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -160,13 +160,13 @@ class MANGOS_DLL_SPEC SpellAuraHolder ~SpellAuraHolder(); private: + SpellEntry const* m_spellProto; + Unit* m_target; ObjectGuid m_casterGuid; ObjectGuid m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted time_t m_applyTime; - SpellEntry const* m_spellProto; - uint8 m_auraSlot; // Aura slot on unit (for show in client) uint8 m_auraFlags; // Aura info flag (for send data to client) uint8 m_auraLevel; // Aura level (store caster level for correct show level dep amount) @@ -447,9 +447,8 @@ class MANGOS_DLL_SPEC Aura bool isAffectedOnSpell(SpellEntry const* spell) const; bool CanProcFrom(SpellEntry const* spell, uint32 procFlag, uint32 EventProcEx, uint32 procEx, bool active, bool useClassMask) const; - //SpellAuraHolder const* GetHolder() const { return m_spellHolder; } SpellAuraHolder* GetHolder() { return m_spellAuraHolder; } - SpellAuraHolder* const GetHolder() const { return m_spellAuraHolder; } + SpellAuraHolder const* GetHolder() const { return m_spellAuraHolder; } bool IsLastAuraOnHolder(); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index f792227e8..85095eca2 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2127,13 +2127,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Shadowflame and Curse of Agony - if (spellInfo_1->SpellIconID == 544 && spellInfo_2->SpellIconID == 3317 || - spellInfo_2->SpellIconID == 544 && spellInfo_1->SpellIconID == 3317) + if ((spellInfo_1->SpellIconID == 544 && spellInfo_2->SpellIconID == 3317) || + (spellInfo_2->SpellIconID == 544 && spellInfo_1->SpellIconID == 3317)) return false; // Shadowflame and Curse of Doom - if (spellInfo_1->SpellIconID == 91 && spellInfo_2->SpellIconID == 3317 || - spellInfo_2->SpellIconID == 91 && spellInfo_1->SpellIconID == 3317) + if ((spellInfo_1->SpellIconID == 91 && spellInfo_2->SpellIconID == 3317) || + (spellInfo_2->SpellIconID == 91 && spellInfo_1->SpellIconID == 3317)) return false; // Metamorphosis, diff effects diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index 47c13a664..107d81892 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -2741,7 +2741,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura if (dummySpell->SpellIconID == 138) { // only main hand melee auto attack affected and Rune Strike - if ((procFlag & PROC_FLAG_SUCCESSFUL_OFFHAND_HIT) || procSpell && procSpell->Id != 56815) + if ((procFlag & PROC_FLAG_SUCCESSFUL_OFFHAND_HIT) || (procSpell && procSpell->Id != 56815)) return SPELL_AURA_PROC_FAILED; // triggered_spell_id in spell data @@ -3519,7 +3519,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d // 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 SPELL_AURA_PROC_FAILED; break; } @@ -3665,7 +3665,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d return SPELL_AURA_PROC_OK; } -SpellAuraProcResult Unit::HandleProcTriggerDamageAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlags, uint32 procEx, uint32 cooldown) +SpellAuraProcResult Unit::HandleProcTriggerDamageAuraProc(Unit* pVictim, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlags*/, uint32 /*procEx*/, uint32 /*cooldown*/) { SpellEntry const* spellInfo = triggeredByAura->GetSpellProto(); DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by auratype %u of spell %u)", @@ -3952,7 +3952,7 @@ SpellAuraProcResult Unit::HandleAddPctModifierAuraProc(Unit* /*pVictim*/, uint32 return SPELL_AURA_PROC_OK; } -SpellAuraProcResult Unit::HandleModDamagePercentDoneAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 /*procFlag*/, uint32 procEx, uint32 cooldown) +SpellAuraProcResult Unit::HandleModDamagePercentDoneAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) { SpellEntry const* spellInfo = triggeredByAura->GetSpellProto(); Item* castItem = triggeredByAura->GetCastItemGuid() && GetTypeId() == TYPEID_PLAYER @@ -3991,7 +3991,7 @@ SpellAuraProcResult Unit::HandleModRating(Unit* /*pVictim*/, uint32 /*damage*/, return SPELL_AURA_PROC_OK; } -SpellAuraProcResult Unit::HandleSpellMagnetAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) +SpellAuraProcResult Unit::HandleSpellMagnetAuraProc(Unit* /*pVictim*/, uint32 damage, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) { if (triggeredByAura->GetId() == 8178) // Grounding Totem Effect { @@ -4005,7 +4005,7 @@ SpellAuraProcResult Unit::HandleSpellMagnetAuraProc(Unit* pVictim, uint32 damage return SPELL_AURA_PROC_OK; } -SpellAuraProcResult Unit::HandleManaShieldAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) +SpellAuraProcResult Unit::HandleManaShieldAuraProc(Unit* pVictim, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) { SpellEntry const* dummySpell = triggeredByAura->GetSpellProto(); @@ -4077,7 +4077,7 @@ SpellAuraProcResult Unit::HandleModResistanceAuraProc(Unit* /*pVictim*/, uint32 return SPELL_AURA_PROC_OK; } -SpellAuraProcResult Unit::HandleRemoveByDamageChanceProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) +SpellAuraProcResult Unit::HandleRemoveByDamageChanceProc(Unit* /*pVictim*/, uint32 damage, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) { // The chance to dispel an aura depends on the damage taken with respect to the casters level. uint32 max_dmg = getLevel() > 8 ? 25 * getLevel() - 150 : 50; diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 7b9cf9691..5a8a81b07 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -193,7 +193,7 @@ class PacketFilter explicit PacketFilter(WorldSession* pSession) : m_pSession(pSession) {} virtual ~PacketFilter() {} - virtual bool Process(WorldPacket* packet) { return true; } + virtual bool Process(WorldPacket* /*packet*/) { return true; } virtual bool ProcessLogout() const { return true; } protected: diff --git a/src/game/movement/MoveSpline.cpp b/src/game/movement/MoveSpline.cpp index fa133dd5d..f2f6ef98c 100644 --- a/src/game/movement/MoveSpline.cpp +++ b/src/game/movement/MoveSpline.cpp @@ -189,7 +189,7 @@ namespace Movement } MoveSpline::MoveSpline() : m_Id(0), time_passed(0), - vertical_acceleration(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0), initialOrientation(0.f) + vertical_acceleration(0.f), initialOrientation(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0) { splineflags.done = true; } diff --git a/src/game/movement/MoveSplineFlag.h b/src/game/movement/MoveSplineFlag.h index fb140d468..8f330a31a 100644 --- a/src/game/movement/MoveSplineFlag.h +++ b/src/game/movement/MoveSplineFlag.h @@ -99,14 +99,14 @@ namespace Movement void operator &= (uint32 f) { raw() &= f;} void operator |= (uint32 f) { raw() |= f;} - void EnableAnimation(uint8 anim) { raw() = raw() & ~(Mask_Animations | Falling | Parabolic) | Animation | anim;} - void EnableParabolic() { raw() = raw() & ~(Mask_Animations | Falling | Animation) | Parabolic;} - void EnableFalling() { raw() = raw() & ~(Mask_Animations | Parabolic | Animation) | Falling;} - void EnableFlying() { raw() = raw() & ~Catmullrom | Flying; } - void EnableCatmullRom() { raw() = raw() & ~Flying | Catmullrom; } - void EnableFacingPoint() { raw() = raw() & ~Mask_Final_Facing | Final_Point;} - void EnableFacingAngle() { raw() = raw() & ~Mask_Final_Facing | Final_Angle;} - void EnableFacingTarget() { raw() = raw() & ~Mask_Final_Facing | Final_Target;} + void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations | Falling | Parabolic)) | Animation | anim;} + void EnableParabolic() { raw() = (raw() & ~(Mask_Animations | Falling | Animation)) | Parabolic;} + void EnableFalling() { raw() = (raw() & ~(Mask_Animations | Parabolic | Animation)) | Falling;} + void EnableFlying() { raw() = (raw() & ~Catmullrom) | Flying; } + void EnableCatmullRom() { raw() = (raw() & ~Flying) | Catmullrom; } + void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point;} + void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle;} + void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target;} uint8 animId : 8; bool done : 1; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 48dcca9fc..3d49dd36e 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12064" + #define REVISION_NR "12065" #endif // __REVISION_NR_H__