diff --git a/src/game/AuctionHouseBot/AuctionHouseBot.cpp b/src/game/AuctionHouseBot/AuctionHouseBot.cpp index 0cc6703cb..4b4b68e59 100644 --- a/src/game/AuctionHouseBot/AuctionHouseBot.cpp +++ b/src/game/AuctionHouseBot/AuctionHouseBot.cpp @@ -577,7 +577,7 @@ uint32 AuctionBotBuyer::GetBuyableEntry(AHB_Buyer_Config& config) } DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: %u items added to buyable vector for ah type: %u",count, config.GetHouseType()); - DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: SameItemInfo size = %u", config.SameItemInfo.size()); + DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: SameItemInfo size = " SIZEFMTD, config.SameItemInfo.size()); return count; } @@ -593,7 +593,7 @@ void AuctionBotBuyer::PrepareListOfEntry(AHB_Buyer_Config& config) ++itr; } - DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: CheckedEntry size = %u",config.CheckedEntry.size()); + DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: CheckedEntry size = " SIZEFMTD, config.CheckedEntry.size()); } bool AuctionBotBuyer::IsBuyableEntry(uint32 buyoutPrice, double InGame_BuyPrice, double MaxBuyablePrice, uint32 MinBuyPrice, uint32 MaxChance, uint32 ChanceRatio) diff --git a/src/game/AuctionHouseHandler.cpp b/src/game/AuctionHouseHandler.cpp index 9d01e2720..ee1c9bf26 100644 --- a/src/game/AuctionHouseHandler.cpp +++ b/src/game/AuctionHouseHandler.cpp @@ -708,9 +708,6 @@ void WorldSession::HandleAuctionListPendingSales(WorldPacket & recv_data) if (!auctionHouseEntry) return; - // always return pointer - AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(auctionHouseEntry); - uint32 count = 0; WorldPacket data(SMSG_AUCTION_LIST_PENDING_SALES, 4); diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp index 04c6f8b4a..f44e9f9c4 100644 --- a/src/game/BattleGroundHandler.cpp +++ b/src/game/BattleGroundHandler.cpp @@ -161,8 +161,8 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data ) BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId]; if (joinAsGroup) { - GroupQueueInfo * ginfo; - uint32 avgTime; + GroupQueueInfo* ginfo = NULL; + uint32 avgTime = 0; if(err > 0) { @@ -734,7 +734,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data ) BattleGroundQueue &bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId]; if (asGroup) { - uint32 avgTime; + uint32 avgTime = 0; if(err > 0) { diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 355d20c9e..01459ff78 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1503,14 +1503,14 @@ valid examples: std::istringstream reader(message); char buffer[256]; - uint32 color; + uint32 color = 0; - ItemPrototype const* linkedItem; - Quest const* linkedQuest; - SpellEntry const *linkedSpell; - AchievementEntry const* linkedAchievement; - ItemRandomPropertiesEntry const* itemProperty; - ItemRandomSuffixEntry const* itemSuffix; + ItemPrototype const* linkedItem = NULL; + Quest const* linkedQuest = NULL; + SpellEntry const *linkedSpell= NULL; + AchievementEntry const* linkedAchievement = NULL; + ItemRandomPropertiesEntry const* itemProperty = NULL; + ItemRandomSuffixEntry const* itemSuffix = NULL; while(!reader.eof()) { diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp index c08a29e3b..50ec98637 100644 --- a/src/game/CreatureEventAIMgr.cpp +++ b/src/game/CreatureEventAIMgr.cpp @@ -156,7 +156,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use) m_CreatureEventAI_Summon_Map.clear(); // Gather additional data for EventAI - QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM creature_ai_summons"); + QueryResult* result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM creature_ai_summons"); if (result) { BarGoLink bar(result->GetRowCount()); @@ -169,21 +169,21 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use) CreatureEventAI_Summon temp; - uint32 i = fields[0].GetUInt32(); - temp.position_x = fields[1].GetFloat(); - temp.position_y = fields[2].GetFloat(); - temp.position_z = fields[3].GetFloat(); - temp.orientation = fields[4].GetFloat(); - temp.SpawnTimeSecs = fields[5].GetUInt32(); + temp.id = fields[0].GetUInt32(); + temp.position_x = fields[1].GetFloat(); + temp.position_y = fields[2].GetFloat(); + temp.position_z = fields[3].GetFloat(); + temp.orientation = fields[4].GetFloat(); + temp.SpawnTimeSecs = fields[5].GetUInt32(); - if (!MaNGOS::IsValidMapCoord(temp.position_x,temp.position_y,temp.position_z,temp.orientation)) + if (!MaNGOS::IsValidMapCoord(temp.position_x, temp.position_y, temp.position_z, temp.orientation)) { - sLog.outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f,%f,%f,%f), skipping.", i,temp.position_x,temp.position_y,temp.position_z,temp.orientation); + sLog.outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f, %f, %f, %f), skipping.", temp.id, temp.position_x, temp.position_y, temp.position_z, temp.orientation); continue; } //Add to map - m_CreatureEventAI_Summon_Map[i] = temp; + m_CreatureEventAI_Summon_Map[temp.id] = temp; ++Count; }while (result->NextRow()); diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index f5ccfcef6..9f718dcdc 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -95,7 +95,7 @@ bool DynamicObject::Create(uint32 guidlow, Unit *caster, uint32 spellId, SpellEf SpellEntry const* spellProto = sSpellStore.LookupEntry(spellId); if (!spellProto) { - sLog.outError("DynamicObject (spell %u) not created. Spell not exist!", spellId, GetPositionX(), GetPositionY()); + sLog.outError("DynamicObject (spell %u) not created. Spell not exist!", spellId); return false; } diff --git a/src/game/HostileRefManager.cpp b/src/game/HostileRefManager.cpp index 4e3328e8d..ee8af4582 100644 --- a/src/game/HostileRefManager.cpp +++ b/src/game/HostileRefManager.cpp @@ -40,9 +40,6 @@ HostileRefManager::~HostileRefManager() void HostileRefManager::threatAssist(Unit *pVictim, float pThreat, SpellEntry const *pThreatSpell, bool pSingleTarget) { - float redirectedMod = pVictim->getHostileRefManager().GetThreatRedirectionMod(); - Unit* redirectedTarget = redirectedMod ? pVictim->getHostileRefManager().GetThreatRedirectionTarget() : NULL; - uint32 size = pSingleTarget ? 1 : getSize(); // if pSingleTarget do not devide threat float threat = pThreat/size; HostileReference* ref = getFirst(); diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index eb0554901..feccf9d9b 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -4672,10 +4672,6 @@ bool ChatHandler::HandleLookupPoolCommand(char * args) return false; std::string namepart = args; - - Player* player = m_session ? m_session->GetPlayer() : NULL; - MapPersistentState* mapState = player ? player->GetMap()->GetPersistentState() : NULL; - strToLower(namepart); uint32 counter = 0; @@ -4719,7 +4715,6 @@ bool ChatHandler::HandlePoolListCommand(char* args) // spawn pools for expected map or for not initialized shared pools state for non-instanceable maps for(uint16 pool_id = 0; pool_id < sPoolMgr.GetMaxPoolId(); ++pool_id) { - PoolTemplateData const& pool_template = sPoolMgr.GetPoolTemplate(pool_id); if (sPoolMgr.GetPoolTemplate(pool_id).CanBeSpawnedAtMap(mapState->GetMapEntry())) { ShowPoolListHelper(pool_id); diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp index fedb35779..c59f83baf 100644 --- a/src/game/MapManager.cpp +++ b/src/game/MapManager.cpp @@ -125,7 +125,7 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj) Map* MapManager::CreateBgMap(uint32 mapid, BattleGround* bg) { - TerrainInfo * pData = sTerrainMgr.LoadTerrain(mapid); + sTerrainMgr.LoadTerrain(mapid); Guard _guard(*this); return CreateBattleGroundMap(mapid, sObjectMgr.GenerateInstanceLowGuid(), bg); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 100c3e940..999eab6e2 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1675,7 +1675,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // We have to perform this check before the teleport, otherwise the // ObjectAccessor won't find the flag. if (duel && GetMapId() != mapid) - if (GameObject* obj = GetMap()->GetGameObject(GetGuidValue(PLAYER_DUEL_ARBITER))) + if (GetMap()->GetGameObject(GetGuidValue(PLAYER_DUEL_ARBITER))) DuelComplete(DUEL_FLED); // reset movement flags at teleport, because player will continue move with these flags after teleport @@ -3268,7 +3268,7 @@ bool Player::IsNeedCastPassiveLikeSpellAtLearn(SpellEntry const* spellInfo) cons // note: form passives activated with shapeshift spells be implemented by HandleShapeshiftBoosts instead of spell_learn_spell // talent dependent passives activated at form apply have proper stance data - bool need_cast = !spellInfo->Stances || !form && spellInfo->HasAttribute(SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT); + bool need_cast = !spellInfo->Stances || (!form && spellInfo->HasAttribute(SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT)); // Check CasterAuraStates return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState))); diff --git a/src/game/PoolManager.cpp b/src/game/PoolManager.cpp index 1c202bf6e..cd406cd34 100644 --- a/src/game/PoolManager.cpp +++ b/src/game/PoolManager.cpp @@ -378,8 +378,6 @@ void PoolGroup::Spawn1Object(MapPersistentState& mapState, PoolObject* { if (CreatureData const* data = sObjectMgr.GetCreatureData(obj->guid)) { - MapEntry const* mapEntry = sMapStore.LookupEntry(data->mapid); - // for non-instanceable maps pool spawn can be at different map from provided mapState if (MapPersistentState* dataMapState = mapState.GetMapId() == data->mapid ? &mapState : sMapPersistentStateMgr.GetPersistentState(data->mapid, 0)) { @@ -424,8 +422,6 @@ void PoolGroup::Spawn1Object(MapPersistentState& mapState, PoolObjec { if (GameObjectData const* data = sObjectMgr.GetGOData(obj->guid)) { - MapEntry const* mapEntry = sMapStore.LookupEntry(data->mapid); - // for non-instanceable maps pool spawn can be at different map from provided mapState if (MapPersistentState* dataMapState = mapState.GetMapId() == data->mapid ? &mapState : sMapPersistentStateMgr.GetPersistentState(data->mapid, 0)) { @@ -870,7 +866,7 @@ void PoolManager::LoadFromDB() goinfo->type != GAMEOBJECT_TYPE_GOOBER && goinfo->type != GAMEOBJECT_TYPE_FISHINGHOLE) { - sLog.outErrorDb("`pool_gameobject_template` has a not lootable gameobject spawn (GUID: %u Entry % Type: %u) defined for pool id (%u), skipped.", guid, entry_id, goinfo->type, pool_id ); + sLog.outErrorDb("`pool_gameobject_template` has a not lootable gameobject spawn (GUID: %u Entry %u Type: %u) defined for pool id (%u), skipped.", guid, entry_id, goinfo->type, pool_id); continue; } if (pool_id > max_pool_id) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 0bc18a6fe..e064358cd 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4529,7 +4529,7 @@ void Spell::SendLoot(ObjectGuid guid, LootType loottype, LockType lockType) sLog.outError("Spell::SendLoot unhandled locktype %u for GameObject trap (entry %u) for spell %u.", lockType, gameObjTarget->GetEntry(), m_spellInfo->Id); return; default: - sLog.outError("Spell::SendLoot unhandled GameObject type %u (entry %u).", gameObjTarget->GetGoType(), gameObjTarget->GetEntry(), m_spellInfo->Id); + sLog.outError("Spell::SendLoot unhandled GameObject type %u (entry %u) for spell %u.", gameObjTarget->GetGoType(), gameObjTarget->GetEntry(), m_spellInfo->Id); return; } } diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 93f3df7b1..b7cacee6a 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1530,7 +1530,7 @@ void SpellMgr::LoadSpellBonuses() need_direct = true; // Check if direct_bonus is needed in `spell_bonus_data` - float direct_calc; + float direct_calc = 0.0f; float direct_diff = 1000.0f; // for have big diff if no DB field value if (sbe.direct_damage) { @@ -1550,7 +1550,7 @@ void SpellMgr::LoadSpellBonuses() } // Check if dot_bonus is needed in `spell_bonus_data` - float dot_calc; + float dot_calc = 0.0f; float dot_diff = 1000.0f; // for have big diff if no DB field value if (sbe.dot_damage) { @@ -1756,7 +1756,6 @@ struct DoSpellThreat if (ste.threat || ste.ap_bonus != 0.f) { const uint32 *targetA = spell->EffectImplicitTargetA; - const uint32 *targetB = spell->EffectImplicitTargetB; if ((targetA[EFFECT_INDEX_1] && targetA[EFFECT_INDEX_1] != targetA[EFFECT_INDEX_0]) || (targetA[EFFECT_INDEX_2] && targetA[EFFECT_INDEX_2] != targetA[EFFECT_INDEX_0])) sLog.outErrorDb("Spell %u listed in `spell_threat` has effects with different targets, threat may be assigned incorrectly", spell->Id); diff --git a/src/game/World.cpp b/src/game/World.cpp index b8e4e4b35..4dc47fff8 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -130,7 +130,7 @@ World::~World() m_weathers.clear(); - CliCommandHolder* command; + CliCommandHolder* command = NULL; while (cliCmdQueue.next(command)) delete command; diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index a769198bc..837e7d69f 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -110,7 +110,7 @@ WorldSession::~WorldSession() } ///- empty incoming packet queue - WorldPacket* packet; + WorldPacket* packet = NULL; while(_recvQueue.next(packet)) delete packet; } @@ -202,7 +202,7 @@ bool WorldSession::Update(PacketFilter& updater) { ///- Retrieve packets from the receive queue and call the appropriate handlers /// not process packets if socket already closed - WorldPacket* packet; + WorldPacket* packet = NULL; while (m_Socket && !m_Socket->IsClosed() && _recvQueue.next(packet, updater)) { /*#if 1 diff --git a/src/game/movement/MoveSpline.h b/src/game/movement/MoveSpline.h index d8c0a3a89..e40054ede 100644 --- a/src/game/movement/MoveSpline.h +++ b/src/game/movement/MoveSpline.h @@ -47,7 +47,6 @@ namespace Movement Result_NextCycle = 0x04, Result_NextSegment = 0x08, }; - #pragma region fields friend class PacketBuilder; protected: MySpline spline; @@ -87,7 +86,6 @@ namespace Movement void _Finalize(); void _Interrupt() { splineflags.done = true;} - #pragma endregion public: void Initialize(const MoveSplineInitArgs&); diff --git a/src/game/movement/spline.h b/src/game/movement/spline.h index 7ef626bfa..dd345670a 100644 --- a/src/game/movement/spline.h +++ b/src/game/movement/spline.h @@ -39,7 +39,6 @@ public: ModesEnd }; - #pragma region fields protected: ControlArray points; @@ -84,10 +83,9 @@ protected: void UninitializedSpline() const { MANGOS_ASSERT(false);} - #pragma endregion public: - explicit SplineBase() : m_mode(UninitializedMode), index_lo(0), index_hi(0), cyclic(false) {} + explicit SplineBase() : index_lo(0), index_hi(0), m_mode(UninitializedMode), cyclic(false) {} /** Caclulates the position for given segment Idx, and percent of segment length t @param t - percent of segment length, assumes that t in range [0, 1] @@ -138,13 +136,11 @@ class Spline : public SplineBase public: typedef length_type LengthType; typedef std::vector LengthArray; - #pragma region fields protected: LengthArray lengths; index_type computeIndexInBounds(length_type length) const; - #pragma endregion public: explicit Spline(){} diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5dc93f4f0..4d2d8b631 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 "12020" + #define REVISION_NR "12021" #endif // __REVISION_NR_H__