diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index 9f7b68702..1c86c9daa 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -2215,9 +2215,9 @@ AchievementCriteriaEntryList const& AchievementGlobalMgr::GetAchievementCriteria void AchievementGlobalMgr::LoadAchievementCriteriaList() { - if(sAchievementCriteriaStore.GetNumRows()==0) + if (sAchievementCriteriaStore.GetNumRows()==0) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -2225,7 +2225,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() return; } - barGoLink bar( sAchievementCriteriaStore.GetNumRows() ); + BarGoLink bar(sAchievementCriteriaStore.GetNumRows()); for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId) { bar.step(); @@ -2248,7 +2248,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() { if(sAchievementStore.GetNumRows()==0) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -2257,13 +2257,13 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() } uint32 count = 0; - barGoLink bar( sAchievementStore.GetNumRows() ); + BarGoLink bar(sAchievementStore.GetNumRows()); for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId) { bar.step(); AchievementEntry const* achievement = sAchievementStore.LookupEntry(entryId); - if(!achievement || !achievement->refAchievement) + if (!achievement || !achievement->refAchievement) continue; m_AchievementListByReferencedId[achievement->refAchievement].push_back(achievement); @@ -2271,7 +2271,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() } sLog.outString(); - sLog.outString(">> Loaded %u achievement references.",count); + sLog.outString(">> Loaded %u achievement references.", count); } void AchievementGlobalMgr::LoadAchievementCriteriaRequirements() @@ -2280,9 +2280,9 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements() QueryResult *result = WorldDatabase.Query("SELECT criteria_id, type, value1, value2 FROM achievement_criteria_requirement"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -2292,7 +2292,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements() uint32 count = 0; uint32 disabled_count = 0; - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { bar.step(); @@ -2409,9 +2409,9 @@ void AchievementGlobalMgr::LoadCompletedAchievements() { QueryResult *result = CharacterDatabase.Query("SELECT achievement FROM character_achievement GROUP BY achievement"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -2419,14 +2419,14 @@ void AchievementGlobalMgr::LoadCompletedAchievements() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { bar.step(); Field *fields = result->Fetch(); uint32 achievement_id = fields[0].GetUInt32(); - if(!sAchievementStore.LookupEntry(achievement_id)) + if (!sAchievementStore.LookupEntry(achievement_id)) { // we will remove nonexistent achievement for all characters sLog.outError("Nonexistent achievement %u data removed from table `character_achievement`.",achievement_id); @@ -2450,9 +2450,9 @@ void AchievementGlobalMgr::LoadRewards() // 0 1 2 3 4 5 6 7 QueryResult *result = WorldDatabase.Query("SELECT entry, gender, title_A, title_H, item, sender, subject, text FROM achievement_reward"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -2462,7 +2462,7 @@ void AchievementGlobalMgr::LoadRewards() } uint32 count = 0; - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -2581,9 +2581,9 @@ void AchievementGlobalMgr::LoadRewardLocales() QueryResult *result = WorldDatabase.Query("SELECT entry,gender,subject_loc1,text_loc1,subject_loc2,text_loc2,subject_loc3,text_loc3,subject_loc4,text_loc4,subject_loc5,text_loc5,subject_loc6,text_loc6,subject_loc7,text_loc7,subject_loc8,text_loc8 FROM locales_achievement_reward"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -2592,7 +2592,7 @@ void AchievementGlobalMgr::LoadRewardLocales() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -2601,7 +2601,7 @@ void AchievementGlobalMgr::LoadRewardLocales() uint32 entry = fields[0].GetUInt32(); - if(m_achievementRewards.find(entry)==m_achievementRewards.end()) + if (m_achievementRewards.find(entry)==m_achievementRewards.end()) { sLog.outErrorDb( "Table `locales_achievement_reward` (Entry: %u) has locale strings for nonexistent achievement reward .", entry); continue; diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp index d671bf372..7013e89f7 100644 --- a/src/game/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouseMgr.cpp @@ -291,14 +291,14 @@ void AuctionHouseMgr::LoadAuctionItems() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outString(">> Loaded 0 auction items"); return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); uint32 count = 0; @@ -342,7 +342,7 @@ void AuctionHouseMgr::LoadAuctions() QueryResult *result = CharacterDatabase.Query("SELECT COUNT(*) FROM auction"); if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outString(">> Loaded 0 auctions. DB table `auction` is empty."); @@ -355,7 +355,7 @@ void AuctionHouseMgr::LoadAuctions() if (!AuctionCount) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outString(">> Loaded 0 auctions. DB table `auction` is empty."); @@ -365,14 +365,14 @@ void AuctionHouseMgr::LoadAuctions() result = CharacterDatabase.Query("SELECT id,houseid,itemguid,item_template,itemowner,buyoutprice,time,moneyTime,buyguid,lastbid,startbid,deposit FROM auction"); if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outString(">> Loaded 0 auctions. DB table `auction` is empty."); return; } - barGoLink bar(AuctionCount); + BarGoLink bar(AuctionCount); typedef std::map PlayerNames; PlayerNames playerNames; // caching for load time diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 09c69e59c..f036f8b00 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1612,7 +1612,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -1621,7 +1621,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -2025,15 +2025,15 @@ void BattleGroundMgr::LoadBattleMastersEntry() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded 0 battlemaster entries - table is empty!" ); + sLog.outString(">> Loaded 0 battlemaster entries - table is empty!"); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -2046,13 +2046,13 @@ void BattleGroundMgr::LoadBattleMastersEntry() uint32 bgTypeId = fields[1].GetUInt32(); if (!sBattlemasterListStore.LookupEntry(bgTypeId)) { - sLog.outErrorDb("Table `battlemaster_entry` contain entry %u for nonexistent battleground type %u, ignored.",entry,bgTypeId); + sLog.outErrorDb("Table `battlemaster_entry` contain entry %u for nonexistent battleground type %u, ignored.", entry, bgTypeId); continue; } mBattleMastersMap[entry] = BattleGroundTypeId(bgTypeId); - } while( result->NextRow() ); + } while(result->NextRow()); delete result; @@ -2135,9 +2135,9 @@ void BattleGroundMgr::LoadBattleEventIndexes() "LEFT OUTER JOIN battleground_events AS description ON data.map = description.map " "AND data.ev1 = description.event1 AND data.ev2 = description.event2 " "ORDER BY m, ev1, ev2" ); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -2145,7 +2145,7 @@ void BattleGroundMgr::LoadBattleEventIndexes() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { diff --git a/src/game/CharacterDatabaseCleaner.cpp b/src/game/CharacterDatabaseCleaner.cpp index 0c703108b..59b8fa21f 100644 --- a/src/game/CharacterDatabaseCleaner.cpp +++ b/src/game/CharacterDatabaseCleaner.cpp @@ -61,7 +61,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table bool found = false; std::ostringstream ss; - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { bar.step(); @@ -70,9 +70,9 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table uint32 id = fields[0].GetUInt32(); - if(!check(id)) + if (!check(id)) { - if(!found) + if (!found) { ss << "DELETE FROM " << table << " WHERE " << column << " IN ("; found = true; @@ -82,7 +82,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table ss << id; } } - while( result->NextRow() ); + while (result->NextRow()); delete result; if (found) diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp index d9e3e5f1d..852824a54 100644 --- a/src/game/CreatureEventAIMgr.cpp +++ b/src/game/CreatureEventAIMgr.cpp @@ -44,7 +44,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use) sLog.outString("Loading EventAI Texts additional data..."); if (result) { - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); uint32 count = 0; do @@ -105,7 +105,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use) } else { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outString(">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty."); @@ -159,7 +159,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use) QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM creature_ai_summons"); if (result) { - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); uint32 Count = 0; do @@ -176,7 +176,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use) 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); continue; @@ -196,7 +196,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use) sLog.outString(">> Loaded %u CreatureEventAI summon definitions", Count); }else { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outString(">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty."); @@ -253,7 +253,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() "FROM creature_ai_scripts"); if (result) { - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); uint32 Count = 0; do @@ -822,7 +822,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() sLog.outString(">> Loaded %u CreatureEventAI scripts", Count); }else { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outString(">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty."); diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index 7dd470b45..ea0e0449c 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -283,7 +283,7 @@ struct LocalData }; template -inline void LoadDBC(LocalData& localeData,barGoLink& bar, StoreProblemList& errlist, DBCStorage& storage, const std::string& dbc_path, const std::string& filename) +inline void LoadDBC(LocalData& localeData, BarGoLink& bar, StoreProblemList& errlist, DBCStorage& storage, const std::string& dbc_path, const std::string& filename) { // compatibility format and C++ structure sizes MANGOS_ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename)); @@ -364,7 +364,7 @@ void LoadDBCStores(const std::string& dataPath) const uint32 DBCFilesCount = 92; - barGoLink bar( (int)DBCFilesCount ); + BarGoLink bar(DBCFilesCount); StoreProblemList bad_dbc_files; @@ -373,9 +373,9 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaStore, dbcPath,"AreaTable.dbc"); // must be after sAreaStore loading - for(uint32 i = 0; i < sAreaStore.GetNumRows(); ++i) // areaflag numbered from 0 + for (uint32 i = 0; i < sAreaStore.GetNumRows(); ++i) // areaflag numbered from 0 { - if(AreaTableEntry const* area = sAreaStore.LookupEntry(i)) + if (AreaTableEntry const* area = sAreaStore.LookupEntry(i)) { // fill AreaId->DBC records sAreaFlagByAreaID.insert(AreaFlagByAreaID::value_type(uint16(area->ID),area->exploreFlag)); diff --git a/src/game/GMTicketMgr.cpp b/src/game/GMTicketMgr.cpp index 1b28c5226..4d72878cb 100644 --- a/src/game/GMTicketMgr.cpp +++ b/src/game/GMTicketMgr.cpp @@ -38,7 +38,7 @@ void GMTicketMgr::LoadGMTickets() if( !result ) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); @@ -47,7 +47,7 @@ void GMTicketMgr::LoadGMTickets() return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { diff --git a/src/game/GameEventMgr.cpp b/src/game/GameEventMgr.cpp index c5875cc54..a6b92568e 100644 --- a/src/game/GameEventMgr.cpp +++ b/src/game/GameEventMgr.cpp @@ -110,7 +110,7 @@ void GameEventMgr::LoadFromDB() } QueryResult *result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description FROM game_event"); - if( !result ) + if (!result) { mGameEvent.clear(); sLog.outString(">> Table game_event is empty!"); @@ -121,7 +121,7 @@ void GameEventMgr::LoadFromDB() uint32 count = 0; { - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { ++count; @@ -183,9 +183,9 @@ void GameEventMgr::LoadFromDB() "FROM creature JOIN game_event_creature ON creature.guid = game_event_creature.guid"); count = 0; - if( !result ) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -194,7 +194,7 @@ void GameEventMgr::LoadFromDB() else { - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -261,9 +261,9 @@ void GameEventMgr::LoadFromDB() "FROM gameobject JOIN game_event_gameobject ON gameobject.guid=game_event_gameobject.guid"); count = 0; - if( !result ) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -272,7 +272,7 @@ void GameEventMgr::LoadFromDB() else { - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -352,9 +352,9 @@ void GameEventMgr::LoadFromDB() "FROM creature JOIN game_event_creature_data ON creature.guid=game_event_creature_data.guid"); count = 0; - if( !result ) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -363,7 +363,7 @@ void GameEventMgr::LoadFromDB() else { - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -432,9 +432,9 @@ void GameEventMgr::LoadFromDB() result = WorldDatabase.Query("SELECT quest, event FROM game_event_quest"); count = 0; - if( !result ) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -443,7 +443,7 @@ void GameEventMgr::LoadFromDB() else { - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -494,7 +494,7 @@ void GameEventMgr::LoadFromDB() count = 0; if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -503,7 +503,7 @@ void GameEventMgr::LoadFromDB() else { - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { Field *fields = result->Fetch(); diff --git a/src/game/GuildMgr.cpp b/src/game/GuildMgr.cpp index ae586312a..5f1314b9d 100644 --- a/src/game/GuildMgr.cpp +++ b/src/game/GuildMgr.cpp @@ -95,7 +95,7 @@ void GuildMgr::LoadGuilds() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -123,7 +123,7 @@ void GuildMgr::LoadGuilds() // 0 1 2 3 4 QueryResult* guildBankTabRightsResult = CharacterDatabase.Query("SELECT guildid,TabId,rid,gbright,SlotPerDay FROM guild_bank_right ORDER BY guildid ASC, TabId ASC"); - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { diff --git a/src/game/ItemEnchantmentMgr.cpp b/src/game/ItemEnchantmentMgr.cpp index dd61ea689..80e64df64 100644 --- a/src/game/ItemEnchantmentMgr.cpp +++ b/src/game/ItemEnchantmentMgr.cpp @@ -57,7 +57,7 @@ void LoadRandomEnchantmentsTable() if (result) { - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index 1340a7e5a..c17b816d2 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -102,7 +102,7 @@ void LootStore::LoadLootTable() if (result) { - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { diff --git a/src/game/MapPersistentStateMgr.cpp b/src/game/MapPersistentStateMgr.cpp index 0b1020a20..76690896a 100644 --- a/src/game/MapPersistentStateMgr.cpp +++ b/src/game/MapPersistentStateMgr.cpp @@ -702,7 +702,7 @@ void MapPersistentStateManager::_DelHelper(DatabaseType &db, const char *fields, void MapPersistentStateManager::CleanupInstances() { - barGoLink bar(2); + BarGoLink bar(2); bar.step(); // load reset times and clean expired instances @@ -754,7 +754,7 @@ void MapPersistentStateManager::PackInstances() delete result; } - barGoLink bar( InstanceSet.size() + 1); + BarGoLink bar(InstanceSet.size() + 1); bar.step(); uint32 InstanceNumber = 1; @@ -917,9 +917,9 @@ void MapPersistentStateManager::LoadCreatureRespawnTimes() uint32 count = 0; QueryResult *result = CharacterDatabase.Query("SELECT guid, respawntime, map, instance, difficulty, resettime FROM creature_respawn LEFT JOIN instance ON instance = id"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -928,7 +928,7 @@ void MapPersistentStateManager::LoadCreatureRespawnTimes() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -982,9 +982,9 @@ void MapPersistentStateManager::LoadGameobjectRespawnTimes() QueryResult *result = CharacterDatabase.Query("SELECT guid, respawntime, map, instance, difficulty, resettime FROM gameobject_respawn LEFT JOIN instance ON instance = id"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -993,7 +993,7 @@ void MapPersistentStateManager::LoadGameobjectRespawnTimes() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 412db2061..0ca075eff 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -234,9 +234,9 @@ void ObjectMgr::LoadCreatureLocales() QueryResult *result = WorldDatabase.Query("SELECT entry,name_loc1,subname_loc1,name_loc2,subname_loc2,name_loc3,subname_loc3,name_loc4,subname_loc4,name_loc5,subname_loc5,name_loc6,subname_loc6,name_loc7,subname_loc7,name_loc8,subname_loc8 FROM locales_creature"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -245,7 +245,7 @@ void ObjectMgr::LoadCreatureLocales() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -308,9 +308,9 @@ void ObjectMgr::LoadGossipMenuItemsLocales() "option_text_loc7,box_text_loc7,option_text_loc8,box_text_loc8 " "FROM locales_gossip_menu_option"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -319,7 +319,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -393,9 +393,9 @@ void ObjectMgr::LoadPointOfInterestLocales() QueryResult *result = WorldDatabase.Query("SELECT entry,icon_name_loc1,icon_name_loc2,icon_name_loc3,icon_name_loc4,icon_name_loc5,icon_name_loc6,icon_name_loc7,icon_name_loc8 FROM locales_points_of_interest"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -404,7 +404,7 @@ void ObjectMgr::LoadPointOfInterestLocales() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -1067,7 +1067,7 @@ void ObjectMgr::LoadCreatureModelRace() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -1076,7 +1076,7 @@ void ObjectMgr::LoadCreatureModelRace() return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); uint32 count = 0; @@ -1194,9 +1194,9 @@ void ObjectMgr::LoadCreatures() "LEFT OUTER JOIN pool_creature ON creature.guid = pool_creature.guid " "LEFT OUTER JOIN pool_creature_template ON creature.id = pool_creature_template.id"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -1221,7 +1221,7 @@ void ObjectMgr::LoadCreatures() if (GetMapDifficultyData(i,Difficulty(k))) spawnMasks[i] |= (1 << k); - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -1232,7 +1232,7 @@ void ObjectMgr::LoadCreatures() uint32 entry = fields[ 1].GetUInt32(); CreatureInfo const* cInfo = GetCreatureTemplate(entry); - if(!cInfo) + if (!cInfo) { sLog.outErrorDb("Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry); continue; @@ -1413,9 +1413,9 @@ void ObjectMgr::LoadGameobjects() "LEFT OUTER JOIN pool_gameobject ON gameobject.guid = pool_gameobject.guid " "LEFT OUTER JOIN pool_gameobject_template ON gameobject.id = pool_gameobject_template.id"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -1432,7 +1432,7 @@ void ObjectMgr::LoadGameobjects() if (GetMapDifficultyData(i,Difficulty(k))) spawnMasks[i] |= (1 << k); - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -1693,9 +1693,9 @@ void ObjectMgr::LoadItemLocales() QueryResult *result = WorldDatabase.Query("SELECT entry,name_loc1,description_loc1,name_loc2,description_loc2,name_loc3,description_loc3,name_loc4,description_loc4,name_loc5,description_loc5,name_loc6,description_loc6,name_loc7,description_loc7,name_loc8,description_loc8 FROM locales_item"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -1704,7 +1704,7 @@ void ObjectMgr::LoadItemLocales() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -2354,7 +2354,7 @@ void ObjectMgr::LoadItemConverts() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -2363,7 +2363,7 @@ void ObjectMgr::LoadItemConverts() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -2419,7 +2419,7 @@ void ObjectMgr::LoadItemRequiredTarget() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -2428,7 +2428,7 @@ void ObjectMgr::LoadItemRequiredTarget() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -2523,7 +2523,7 @@ void ObjectMgr::LoadPetLevelInfo() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -2532,14 +2532,14 @@ void ObjectMgr::LoadPetLevelInfo() return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { Field* fields = result->Fetch(); uint32 creature_id = fields[0].GetUInt32(); - if(!sCreatureStorage.LookupEntry(creature_id)) + if (!sCreatureStorage.LookupEntry(creature_id)) { sLog.outErrorDb("Wrong creature id %u in `pet_levelstats` table, ignoring.",creature_id); continue; @@ -2639,7 +2639,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); sLog.outString(); sLog.outString( ">> Loaded %u player create definitions", count ); @@ -2648,7 +2648,7 @@ void ObjectMgr::LoadPlayerInfo() exit(1); } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -2722,7 +2722,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); @@ -2731,7 +2731,7 @@ void ObjectMgr::LoadPlayerInfo() } else { - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -2741,14 +2741,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_class = fields[1].GetUInt32(); ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race); - if(!rEntry || !((1 << (current_race-1)) & RACEMASK_ALL_PLAYABLE)) + if (!rEntry || !((1 << (current_race-1)) & RACEMASK_ALL_PLAYABLE)) { sLog.outErrorDb("Wrong race %u in `playercreateinfo_item` table, ignoring.",current_race); continue; } ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(current_class); - if(!cEntry || !((1 << (current_class-1)) & CLASSMASK_ALL_PLAYABLE)) + if (!cEntry || !((1 << (current_class-1)) & CLASSMASK_ALL_PLAYABLE)) { sLog.outErrorDb("Wrong class %u in `playercreateinfo_item` table, ignoring.",current_class); continue; @@ -2758,7 +2758,7 @@ void ObjectMgr::LoadPlayerInfo() uint32 item_id = fields[2].GetUInt32(); - if(!GetItemPrototype(item_id)) + if (!GetItemPrototype(item_id)) { sLog.outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.",item_id,current_race,current_class); continue; @@ -2766,7 +2766,7 @@ void ObjectMgr::LoadPlayerInfo() uint32 amount = fields[3].GetUInt32(); - if(!amount) + if (!amount) { sLog.outErrorDb("Item id %u (class %u race %u) have amount==0 in `playercreateinfo_item` table, ignoring.",item_id,current_race,current_class); continue; @@ -2795,7 +2795,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); sLog.outString(); sLog.outString( ">> Loaded %u player create spells", count ); @@ -2803,7 +2803,7 @@ void ObjectMgr::LoadPlayerInfo() } else { - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -2813,7 +2813,7 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_class = fields[1].GetUInt32(); ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race); - if(!rEntry || !((1 << (current_race-1)) & RACEMASK_ALL_PLAYABLE)) + if (!rEntry || !((1 << (current_race-1)) & RACEMASK_ALL_PLAYABLE)) { sLog.outErrorDb("Wrong race %u in `playercreateinfo_spell` table, ignoring.",current_race); continue; @@ -2857,15 +2857,15 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); sLog.outString(); - sLog.outString( ">> Loaded %u player create actions", count ); - sLog.outErrorDb( "Error loading `playercreateinfo_action` table or empty table."); + sLog.outString(">> Loaded %u player create actions", count); + sLog.outErrorDb("Error loading `playercreateinfo_action` table or empty table."); } else { - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -2875,14 +2875,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_class = fields[1].GetUInt32(); ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race); - if(!rEntry || !((1 << (current_race-1)) & RACEMASK_ALL_PLAYABLE)) + if (!rEntry || !((1 << (current_race-1)) & RACEMASK_ALL_PLAYABLE)) { sLog.outErrorDb("Wrong race %u in `playercreateinfo_action` table, ignoring.",current_race); continue; } ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(current_class); - if(!cEntry || !((1 << (current_class-1)) & CLASSMASK_ALL_PLAYABLE)) + if (!cEntry || !((1 << (current_class-1)) & CLASSMASK_ALL_PLAYABLE)) { sLog.outErrorDb("Wrong class %u in `playercreateinfo_action` table, ignoring.",current_class); continue; @@ -2919,7 +2919,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); sLog.outString(); sLog.outString( ">> Loaded %u level health/mana definitions", count ); @@ -2928,28 +2928,28 @@ void ObjectMgr::LoadPlayerInfo() exit(1); } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { Field* fields = result->Fetch(); uint32 current_class = fields[0].GetUInt32(); - if(current_class >= MAX_CLASSES) + if (current_class >= MAX_CLASSES) { sLog.outErrorDb("Wrong class %u in `player_classlevelstats` table, ignoring.",current_class); continue; } uint32 current_level = fields[1].GetUInt32(); - if(current_level == 0) + if (current_level == 0) { sLog.outErrorDb("Wrong level %u in `player_classlevelstats` table, ignoring.",current_level); continue; } - else if(current_level > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)) + else if (current_level > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)) { - if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum + if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum sLog.outErrorDb("Wrong (> %u) level %u in `player_classlevelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level); else { @@ -2961,7 +2961,7 @@ void ObjectMgr::LoadPlayerInfo() PlayerClassInfo* pClassInfo = &playerClassInfo[current_class]; - if(!pClassInfo->levelInfo) + if (!pClassInfo->levelInfo) pClassInfo->levelInfo = new PlayerClassLevelInfo[sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)]; PlayerClassLevelInfo* pClassLevelInfo = &pClassInfo->levelInfo[current_level-1]; @@ -3017,16 +3017,16 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); sLog.outString(); - sLog.outString( ">> Loaded %u level stats definitions", count ); - sLog.outErrorDb( "Error loading `player_levelstats` table or empty table."); + sLog.outString(">> Loaded %u level stats definitions", count); + sLog.outErrorDb("Error loading `player_levelstats` table or empty table."); Log::WaitBeforeContinueIfNeed(); exit(1); } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -3036,23 +3036,23 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_class = fields[1].GetUInt32(); ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race); - if(!rEntry || !((1 << (current_race-1)) & RACEMASK_ALL_PLAYABLE)) + if (!rEntry || !((1 << (current_race-1)) & RACEMASK_ALL_PLAYABLE)) { sLog.outErrorDb("Wrong race %u in `player_levelstats` table, ignoring.",current_race); continue; } ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(current_class); - if(!cEntry || !((1 << (current_class-1)) & CLASSMASK_ALL_PLAYABLE)) + if (!cEntry || !((1 << (current_class-1)) & CLASSMASK_ALL_PLAYABLE)) { sLog.outErrorDb("Wrong class %u in `player_levelstats` table, ignoring.",current_class); continue; } uint32 current_level = fields[2].GetUInt32(); - if(current_level > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)) + if (current_level > sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)) { - if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum + if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum sLog.outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level); else { @@ -3064,15 +3064,13 @@ void ObjectMgr::LoadPlayerInfo() PlayerInfo* pInfo = &playerInfo[current_race][current_class]; - if(!pInfo->levelInfo) + if (!pInfo->levelInfo) pInfo->levelInfo = new PlayerLevelInfo[sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)]; PlayerLevelInfo* pLevelInfo = &pInfo->levelInfo[current_level-1]; - for (int i = 0; i < MAX_STATS; i++) - { + for (int i = 0; i < MAX_STATS; ++i) pLevelInfo->stats[i] = fields[i+3].GetUInt8(); - } bar.step(); ++count; @@ -3145,16 +3143,16 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); sLog.outString(); - sLog.outString( ">> Loaded %u xp for level definitions", count ); - sLog.outErrorDb( "Error loading `player_xp_for_level` table or empty table."); + sLog.outString(">> Loaded %u xp for level definitions", count); + sLog.outErrorDb("Error loading `player_xp_for_level` table or empty table."); Log::WaitBeforeContinueIfNeed(); exit(1); } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -3163,9 +3161,9 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_level = fields[0].GetUInt32(); uint32 current_xp = fields[1].GetUInt32(); - if(current_level >= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)) + if (current_level >= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)) { - if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum + if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum sLog.outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL,current_level); else { @@ -3184,7 +3182,7 @@ void ObjectMgr::LoadPlayerInfo() delete result; sLog.outString(); - sLog.outString( ">> Loaded %u xp for level definitions", count ); + sLog.outString(">> Loaded %u xp for level definitions", count); } // fill level gaps @@ -3311,15 +3309,15 @@ void ObjectMgr::LoadArenaTeams() "EmblemColor,BorderStyle,BorderColor, rating,games_week,wins_week,games_season,wins_season,rank " "FROM arena_team LEFT JOIN arena_team_stats ON arena_team.arenateamid = arena_team_stats.arenateamid ORDER BY arena_team.arenateamid ASC" ); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u arenateam definitions", count ); + sLog.outString(">> Loaded %u arenateam definitions", count); return; } @@ -3329,7 +3327,7 @@ void ObjectMgr::LoadArenaTeams() "SELECT arenateamid,member.guid,played_week,wons_week,played_season,wons_season,personal_rating,name,class " "FROM arena_team_member member LEFT JOIN characters chars on member.guid = chars.guid ORDER BY member.arenateamid ASC"); - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -3346,13 +3344,13 @@ void ObjectMgr::LoadArenaTeams() continue; } AddArenaTeam(newArenaTeam); - }while( result->NextRow() ); + } while (result->NextRow()); delete result; delete arenaTeamMembersResult; sLog.outString(); - sLog.outString( ">> Loaded %u arenateam definitions", count ); + sLog.outString(">> Loaded %u arenateam definitions", count); } void ObjectMgr::LoadGroups() @@ -3364,16 +3362,16 @@ void ObjectMgr::LoadGroups() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u group definitions", count ); + sLog.outString(">> Loaded %u group definitions", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -3401,14 +3399,14 @@ void ObjectMgr::LoadGroups() result = CharacterDatabase.Query("SELECT memberGuid, assistant, subgroup, groupId FROM group_member ORDER BY groupId"); if (!result) { - barGoLink bar2( 1 ); + BarGoLink bar2(1); bar2.step(); } else { Group* group = NULL; // used as cached pointer for avoid relookup group for each member - barGoLink bar2( (int)result->GetRowCount() ); + BarGoLink bar2(result->GetRowCount()); do { bar2.step(); @@ -3470,14 +3468,14 @@ void ObjectMgr::LoadGroups() if (!result) { - barGoLink bar2( 1 ); + BarGoLink bar2(1); bar2.step(); } else { Group* group = NULL; // used as cached pointer for avoid relookup group for each member - barGoLink bar2( (int)result->GetRowCount() ); + BarGoLink bar2(result->GetRowCount()); do { bar2.step(); @@ -3579,13 +3577,13 @@ void ObjectMgr::LoadQuests() // 139 140 "StartScript, CompleteScript" " FROM quest_template"); - if (result == NULL) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded 0 quests definitions" ); + sLog.outString(">> Loaded 0 quests definitions"); sLog.outErrorDb("`quest_template` table is empty!"); return; } @@ -3593,7 +3591,7 @@ void ObjectMgr::LoadQuests() // create multimap previous quest for each existing quest // some quests can have many previous maps set by NextQuestId in previous quest // for example set of race quests can lead to single not race specific quest - barGoLink bar((int) result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { bar.step(); @@ -4236,9 +4234,9 @@ void ObjectMgr::LoadQuestLocales() " FROM locales_quest" ); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -4247,7 +4245,7 @@ void ObjectMgr::LoadQuestLocales() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -4424,9 +4422,9 @@ void ObjectMgr::LoadPageTextLocales() QueryResult *result = WorldDatabase.Query("SELECT entry,text_loc1,text_loc2,text_loc3,text_loc4,text_loc5,text_loc6,text_loc7,text_loc8 FROM locales_page_text"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -4435,7 +4433,7 @@ void ObjectMgr::LoadPageTextLocales() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -4592,17 +4590,17 @@ void ObjectMgr::LoadGossipText() int count = 0; if( !result ) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u npc texts", count ); + sLog.outString(">> Loaded %u npc texts", count); return; } int cic; - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -4614,7 +4612,7 @@ void ObjectMgr::LoadGossipText() bar.step(); uint32 Text_ID = fields[cic++].GetUInt32(); - if(!Text_ID) + if (!Text_ID) { sLog.outErrorDb("Table `npc_text` has record wit reserved id 0, ignore."); continue; @@ -4622,7 +4620,7 @@ void ObjectMgr::LoadGossipText() GossipText& gText = mGossipText[Text_ID]; - for (int i=0; i< 8; i++) + for (int i = 0; i < 8; ++i) { gText.Options[i].Text_0 = fields[cic++].GetCppString(); gText.Options[i].Text_1 = fields[cic++].GetCppString(); @@ -4630,16 +4628,16 @@ void ObjectMgr::LoadGossipText() gText.Options[i].Language = fields[cic++].GetUInt32(); gText.Options[i].Probability = fields[cic++].GetFloat(); - for(int j=0; j < 3; ++j) + for (int j = 0; j < 3; ++j) { gText.Options[i].Emotes[j]._Delay = fields[cic++].GetUInt32(); gText.Options[i].Emotes[j]._Emote = fields[cic++].GetUInt32(); } } - } while( result->NextRow() ); + } while(result->NextRow()); sLog.outString(); - sLog.outString( ">> Loaded %u npc texts", count ); + sLog.outString(">> Loaded %u npc texts", count); delete result; } @@ -4660,7 +4658,7 @@ void ObjectMgr::LoadGossipTextLocales() if(!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -4669,7 +4667,7 @@ void ObjectMgr::LoadGossipTextLocales() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -4734,9 +4732,9 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) CharacterDatabase.PExecute("DELETE FROM mail WHERE expire_time < '" UI64FMTD "' AND has_items = '0' AND body = ''", (uint64)basetime); // 0 1 2 3 4 5 6 7 8 QueryResult* result = CharacterDatabase.PQuery("SELECT id,messageType,sender,receiver,has_items,expire_time,cod,checked,mailTemplateId FROM mail WHERE expire_time < '" UI64FMTD "'", (uint64)basetime); - if ( !result ) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outString(">> Only expired mails (need to be return or delete) or DB table `mail` is empty."); @@ -4748,7 +4746,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) //delitems << "DELETE FROM item_instance WHERE guid IN ( "; //delmails << "DELETE FROM mail WHERE id IN ( " - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); uint32 count = 0; Field *fields; @@ -4842,15 +4840,15 @@ void ObjectMgr::LoadQuestAreaTriggers() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u quest trigger points", count ); + sLog.outString(">> Loaded %u quest trigger points", count); return; } - barGoLink bar((int) result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -4906,15 +4904,15 @@ void ObjectMgr::LoadTavernAreaTriggers() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u tavern triggers", count ); + sLog.outString(">> Loaded %u tavern triggers", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -5050,17 +5048,17 @@ void ObjectMgr::LoadGraveyardZones() uint32 count = 0; - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u graveyard-zone links", count ); + sLog.outString(">> Loaded %u graveyard-zone links", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -5268,16 +5266,16 @@ void ObjectMgr::LoadAreaTriggerTeleports() if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u area trigger teleport definitions", count ); + sLog.outString(">> Loaded %u area trigger teleport definitions", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -5467,7 +5465,7 @@ void ObjectMgr::PackGroupIds() delete result; } - barGoLink bar( groupIds.size() + 1); + BarGoLink bar(groupIds.size() + 1); bar.step(); uint32 groupId = 1; @@ -5604,7 +5602,7 @@ void ObjectMgr::LoadGameObjectLocales() if(!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -5613,7 +5611,7 @@ void ObjectMgr::LoadGameObjectLocales() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -5920,18 +5918,18 @@ void ObjectMgr::LoadExplorationBaseXP() uint32 count = 0; QueryResult *result = WorldDatabase.Query("SELECT level,basexp FROM exploration_basexp"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u BaseXP definitions", count ); + sLog.outString(">> Loaded %u BaseXP definitions", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -5969,18 +5967,18 @@ void ObjectMgr::LoadPetNames() uint32 count = 0; QueryResult *result = WorldDatabase.Query("SELECT word,entry,half FROM pet_name_generation"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u pet name parts", count ); + sLog.outString(">> Loaded %u pet name parts", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -5990,7 +5988,7 @@ void ObjectMgr::LoadPetNames() std::string word = fields[0].GetString(); uint32 entry = fields[1].GetUInt32(); bool half = fields[2].GetBool(); - if(half) + if (half) PetHalfName1[entry].push_back(word); else PetHalfName0[entry].push_back(word); @@ -6013,11 +6011,11 @@ void ObjectMgr::LoadPetNumber() delete result; } - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded the max pet number: %d", m_PetNumbers.GetNextAfterMaxUsed()-1); + sLog.outString(">> Loaded the max pet number: %d", m_PetNumbers.GetNextAfterMaxUsed() - 1); } std::string ObjectMgr::GeneratePetName(uint32 entry) @@ -6025,11 +6023,11 @@ std::string ObjectMgr::GeneratePetName(uint32 entry) std::vector & list0 = PetHalfName0[entry]; std::vector & list1 = PetHalfName1[entry]; - if(list0.empty() || list1.empty()) + if (list0.empty() || list1.empty()) { CreatureInfo const *cinfo = GetCreatureTemplate(entry); char const* petname = GetPetName(cinfo->family, sWorld.GetDefaultDbcLocale()); - if(!petname) + if (!petname) petname = cinfo->Name; return std::string(petname); } @@ -6047,18 +6045,18 @@ void ObjectMgr::LoadCorpses() "JOIN characters ON player = characters.guid " "LEFT JOIN guild_member ON player=guild_member.guid WHERE corpse_type <> 0"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u corpses", count ); + sLog.outString(">> Loaded %u corpses", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -6069,7 +6067,7 @@ void ObjectMgr::LoadCorpses() uint32 guid = fields[0].GetUInt32(); Corpse *corpse = new Corpse; - if(!corpse->LoadFromDB(guid,fields)) + if (!corpse->LoadFromDB(guid,fields)) { delete corpse; continue; @@ -6095,7 +6093,7 @@ void ObjectMgr::LoadReputationRewardRate() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -6104,7 +6102,7 @@ void ObjectMgr::LoadReputationRewardRate() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -6167,9 +6165,9 @@ void ObjectMgr::LoadReputationOnKill() "IsTeamAward1, MaxStanding1, RewOnKillRepValue1, IsTeamAward2, MaxStanding2, RewOnKillRepValue2, TeamDependent " "FROM creature_onkill_reputation"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -6178,7 +6176,7 @@ void ObjectMgr::LoadReputationOnKill() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -6244,7 +6242,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -6253,7 +6251,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -6364,9 +6362,9 @@ void ObjectMgr::LoadPointsOfInterest() // 0 1 2 3 4 5 QueryResult *result = WorldDatabase.Query("SELECT entry, x, y, icon, flags, data, icon_name FROM points_of_interest"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -6375,7 +6373,7 @@ void ObjectMgr::LoadPointsOfInterest() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -6418,9 +6416,9 @@ void ObjectMgr::LoadQuestPOI() // 0 1 2 3 4 5 6 7 QueryResult *result = WorldDatabase.Query("SELECT questId, poiId, objIndex, mapId, mapAreaId, floorId, unk3, unk4 FROM quest_poi"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -6429,7 +6427,7 @@ void ObjectMgr::LoadQuestPOI() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -6495,9 +6493,9 @@ void ObjectMgr::LoadNPCSpellClickSpells() // 0 1 2 3 4 5 QueryResult *result = WorldDatabase.Query("SELECT npc_entry, spell_id, quest_start, quest_start_active, quest_end, cast_flags FROM npc_spellclick_spells"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -6506,7 +6504,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -6584,9 +6582,9 @@ void ObjectMgr::LoadWeatherZoneChances() // 0 1 2 3 4 5 6 7 8 9 10 11 12 QueryResult *result = WorldDatabase.Query("SELECT zone, spring_rain_chance, spring_snow_chance, spring_storm_chance, summer_rain_chance, summer_snow_chance, summer_storm_chance, fall_rain_chance, fall_snow_chance, fall_storm_chance, winter_rain_chance, winter_snow_chance, winter_storm_chance FROM game_weather"); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -6595,7 +6593,7 @@ void ObjectMgr::LoadWeatherZoneChances() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -6682,9 +6680,9 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelationsMap& map, char const* tab QueryResult *result = WorldDatabase.PQuery("SELECT id,quest FROM %s",table); - if(!result) + if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -6693,7 +6691,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelationsMap& map, char const* tab return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -6703,7 +6701,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelationsMap& map, char const* tab uint32 id = fields[0].GetUInt32(); uint32 quest = fields[1].GetUInt32(); - if(mQuestTemplates.find(quest) == mQuestTemplates.end()) + if (mQuestTemplates.find(quest) == mQuestTemplates.end()) { sLog.outErrorDb("Table `%s: Quest %u listed for entry %u does not exist.",table,quest,id); continue; @@ -6784,17 +6782,17 @@ void ObjectMgr::LoadReservedPlayersNames() uint32 count = 0; - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u reserved player names", count ); + sLog.outString(">> Loaded %u reserved player names", count); return; } - barGoLink bar((int) result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); Field* fields; do @@ -6804,7 +6802,7 @@ void ObjectMgr::LoadReservedPlayersNames() std::string name= fields[0].GetCppString(); std::wstring wstr; - if(!Utf8toWStr (name,wstr)) + if (!Utf8toWStr (name,wstr)) { sLog.outError("Table `reserved_name` have invalid name: %s", name.c_str() ); continue; @@ -7003,18 +7001,18 @@ void ObjectMgr::LoadGameObjectForQuests() if (!sGOStorage.MaxEntry) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded 0 GameObjects for quests" ); + sLog.outString(">> Loaded 0 GameObjects for quests"); return; } - barGoLink bar(sGOStorage.MaxEntry - 1); + BarGoLink bar(sGOStorage.MaxEntry - 1); uint32 count = 0; // collect GO entries for GO that must activated - for(uint32 go_entry = 1; go_entry < sGOStorage.MaxEntry; ++go_entry) + for (uint32 go_entry = 1; go_entry < sGOStorage.MaxEntry; ++go_entry) { bar.step(); GameObjectInfo const* goInfo = GetGameObjectInfo(go_entry); @@ -7123,7 +7121,7 @@ bool ObjectMgr::LoadMangosStrings(DatabaseType& db, char const* table, int32 min if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -7137,7 +7135,7 @@ bool ObjectMgr::LoadMangosStrings(DatabaseType& db, char const* table, int32 min uint32 count = 0; - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -7230,9 +7228,9 @@ void ObjectMgr::LoadFishingBaseSkillLevel() uint32 count = 0; QueryResult *result = WorldDatabase.Query("SELECT entry,skill FROM skill_fishing_base_level"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); @@ -7241,7 +7239,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() return; } - barGoLink bar((int) result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -7252,7 +7250,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() int32 skill = fields[1].GetInt32(); AreaTableEntry const* fArea = GetAreaEntryByAreaID(entry); - if(!fArea) + if (!fArea) { sLog.outErrorDb("AreaId %u defined in `skill_fishing_base_level` does not exist",entry); continue; @@ -7266,7 +7264,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() delete result; sLog.outString(); - sLog.outString( ">> Loaded %u areas for fishing base skill level", count ); + sLog.outString(">> Loaded %u areas for fishing base skill level", count); } // Searches for the same condition already in Conditions store @@ -7813,9 +7811,9 @@ void ObjectMgr::LoadGameTele() uint32 count = 0; QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); @@ -7824,7 +7822,7 @@ void ObjectMgr::LoadGameTele() return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -7843,13 +7841,13 @@ void ObjectMgr::LoadGameTele() gt.mapId = fields[5].GetUInt32(); gt.name = fields[6].GetCppString(); - if(!MapManager::IsValidMapCoord(gt.mapId,gt.position_x,gt.position_y,gt.position_z,gt.orientation)) + if (!MapManager::IsValidMapCoord(gt.mapId,gt.position_x,gt.position_y,gt.position_z,gt.orientation)) { sLog.outErrorDb("Wrong position for id %u (name: %s) in `game_tele` table, ignoring.",id,gt.name.c_str()); continue; } - if(!Utf8toWStr(gt.name,gt.wnameLow)) + if (!Utf8toWStr(gt.name,gt.wnameLow)) { sLog.outErrorDb("Wrong UTF8 name for id %u in `game_tele` table, ignoring.",id); continue; @@ -7865,7 +7863,7 @@ void ObjectMgr::LoadGameTele() delete result; sLog.outString(); - sLog.outString( ">> Loaded %u GameTeleports", count ); + sLog.outString(">> Loaded %u GameTeleports", count); } GameTele const* ObjectMgr::GetGameTele(const std::string& name) const @@ -7941,9 +7939,9 @@ void ObjectMgr::LoadMailLevelRewards() uint32 count = 0; QueryResult *result = WorldDatabase.Query("SELECT level, raceMask, mailTemplateId, senderEntry FROM mail_level_reward"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); @@ -7952,7 +7950,7 @@ void ObjectMgr::LoadMailLevelRewards() return; } - barGoLink bar((int) result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -8015,7 +8013,7 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates) if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -8024,7 +8022,7 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates) return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); std::set talentIds; @@ -8197,7 +8195,7 @@ void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates) QueryResult *result = WorldDatabase.PQuery("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM %s", tableName); if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); @@ -8206,7 +8204,7 @@ void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates) return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); uint32 count = 0; do @@ -8272,7 +8270,7 @@ void ObjectMgr::LoadNpcGossips() QueryResult* result = WorldDatabase.Query("SELECT npc_guid, textid FROM npc_gossip"); if( !result ) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); @@ -8281,7 +8279,7 @@ void ObjectMgr::LoadNpcGossips() return; } - barGoLink bar((int) result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); uint32 count = 0; uint32 guid,textid; @@ -8324,7 +8322,7 @@ void ObjectMgr::LoadGossipMenu() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -8333,7 +8331,7 @@ void ObjectMgr::LoadGossipMenu() return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); uint32 count = 0; @@ -8415,7 +8413,7 @@ void ObjectMgr::LoadGossipMenuItems() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -8439,7 +8437,7 @@ void ObjectMgr::LoadGossipMenuItems() } // loading - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); uint32 count = 0; diff --git a/src/game/PoolManager.cpp b/src/game/PoolManager.cpp index b527dc747..071db0ed7 100644 --- a/src/game/PoolManager.cpp +++ b/src/game/PoolManager.cpp @@ -595,7 +595,7 @@ void PoolManager::LoadFromDB() uint32 count = 0; - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { ++count; @@ -628,7 +628,7 @@ void PoolManager::LoadFromDB() count = 0; if (!result) { - barGoLink bar2(1); + BarGoLink bar2(1); bar2.step(); sLog.outString(); @@ -637,7 +637,7 @@ void PoolManager::LoadFromDB() else { - barGoLink bar2((int)result->GetRowCount()); + BarGoLink bar2(result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -690,7 +690,7 @@ void PoolManager::LoadFromDB() count = 0; if (!result) { - barGoLink bar2(1); + BarGoLink bar2(1); bar2.step(); sLog.outString(); @@ -698,7 +698,7 @@ void PoolManager::LoadFromDB() } else { - barGoLink bar2((int)result->GetRowCount()); + BarGoLink bar2(result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -767,7 +767,7 @@ void PoolManager::LoadFromDB() count = 0; if (!result) { - barGoLink bar2(1); + BarGoLink bar2(1); bar2.step(); sLog.outString(); @@ -776,7 +776,7 @@ void PoolManager::LoadFromDB() else { - barGoLink bar2((int)result->GetRowCount()); + BarGoLink bar2(result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -838,7 +838,7 @@ void PoolManager::LoadFromDB() count = 0; if (!result) { - barGoLink bar2(1); + BarGoLink bar2(1); bar2.step(); sLog.outString(); @@ -847,7 +847,7 @@ void PoolManager::LoadFromDB() else { - barGoLink bar2((int)result->GetRowCount()); + BarGoLink bar2(result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -922,7 +922,7 @@ void PoolManager::LoadFromDB() count = 0; if( !result ) { - barGoLink bar2(1); + BarGoLink bar2(1); bar2.step(); sLog.outString(); @@ -931,7 +931,7 @@ void PoolManager::LoadFromDB() else { - barGoLink bar2( (int)result->GetRowCount() ); + BarGoLink bar2(result->GetRowCount()); do { Field *fields = result->Fetch(); diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp index f0a4d7c5d..1229b5bca 100644 --- a/src/game/ScriptMgr.cpp +++ b/src/game/ScriptMgr.cpp @@ -92,7 +92,7 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -100,7 +100,7 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -804,7 +804,7 @@ void ScriptMgr::LoadAreaTriggerScripts() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -812,7 +812,7 @@ void ScriptMgr::LoadAreaTriggerScripts() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -848,7 +848,7 @@ void ScriptMgr::LoadEventIdScripts() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -856,13 +856,13 @@ void ScriptMgr::LoadEventIdScripts() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); // TODO: remove duplicate code below, same way to collect event id's used in LoadEventScripts() std::set evt_scripts; // Load all possible event entries from gameobjects - for(uint32 i = 1; i < sGOStorage.MaxEntry; ++i) + for (uint32 i = 1; i < sGOStorage.MaxEntry; ++i) { if (GameObjectInfo const* goInfo = sGOStorage.LookupEntry(i)) { @@ -959,14 +959,14 @@ void ScriptMgr::LoadScriptNames() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outErrorDb(">> Loaded empty set of Script Names!"); return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); uint32 count = 0; do @@ -979,7 +979,7 @@ void ScriptMgr::LoadScriptNames() std::sort(m_scriptNames.begin(), m_scriptNames.end()); sLog.outString(); - sLog.outString( ">> Loaded %d Script Names", count ); + sLog.outString(">> Loaded %d Script Names", count); } uint32 ScriptMgr::GetScriptId(const char *name) const diff --git a/src/game/SkillDiscovery.cpp b/src/game/SkillDiscovery.cpp index 1820ee826..17cc31256 100644 --- a/src/game/SkillDiscovery.cpp +++ b/src/game/SkillDiscovery.cpp @@ -62,7 +62,7 @@ void LoadSkillDiscoveryTable() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); std::ostringstream ssNonDiscoverableEntries; std::set reportedReqSpells; diff --git a/src/game/SkillExtraItems.cpp b/src/game/SkillExtraItems.cpp index dabecfad9..349b3c5ac 100644 --- a/src/game/SkillExtraItems.cpp +++ b/src/game/SkillExtraItems.cpp @@ -61,7 +61,7 @@ void LoadSkillExtraItemTable() if (result) { - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -70,28 +70,28 @@ void LoadSkillExtraItemTable() uint32 spellId = fields[0].GetUInt32(); - if(!sSpellStore.LookupEntry(spellId)) + if (!sSpellStore.LookupEntry(spellId)) { sLog.outError("Skill specialization %u has nonexistent spell id in `skill_extra_item_template`!", spellId); continue; } uint32 requiredSpecialization = fields[1].GetUInt32(); - if(!sSpellStore.LookupEntry(requiredSpecialization)) + if (!sSpellStore.LookupEntry(requiredSpecialization)) { sLog.outError("Skill specialization %u have nonexistent required specialization spell id %u in `skill_extra_item_template`!", spellId,requiredSpecialization); continue; } float additionalCreateChance = fields[2].GetFloat(); - if(additionalCreateChance <= 0.0f) + if (additionalCreateChance <= 0.0f) { sLog.outError("Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId); continue; } uint8 additionalMaxNum = fields[3].GetUInt8(); - if(!additionalMaxNum) + if (!additionalMaxNum) { sLog.outError("Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId); continue; @@ -109,7 +109,7 @@ void LoadSkillExtraItemTable() delete result; sLog.outString(); - sLog.outString( ">> Loaded %u spell specialization definitions", count ); + sLog.outString(">> Loaded %u spell specialization definitions", count); } else { diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 8ab145d1d..578324e94 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -996,7 +996,7 @@ void SpellMgr::LoadSpellTargetPositions() QueryResult *result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position"); if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); @@ -1005,7 +1005,7 @@ void SpellMgr::LoadSpellTargetPositions() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -1274,18 +1274,18 @@ void SpellMgr::LoadSpellProcEvents() // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 QueryResult *result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMaskA0, SpellFamilyMaskA1, SpellFamilyMaskA2, SpellFamilyMaskB0, SpellFamilyMaskB1, SpellFamilyMaskB2, SpellFamilyMaskC0, SpellFamilyMaskC1, SpellFamilyMaskC2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> No spell proc event conditions loaded"); + sLog.outString(">> No spell proc event conditions loaded"); return; } SpellRankHelper rankHelper(*this, mSpellProcEventMap); - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -1339,19 +1339,19 @@ void SpellMgr::LoadSpellProcItemEnchant() // 0 1 QueryResult *result = WorldDatabase.Query("SELECT entry, ppmRate FROM spell_proc_item_enchant"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u proc item enchant definitions", count ); + sLog.outString(">> Loaded %u proc item enchant definitions", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -1409,16 +1409,16 @@ void SpellMgr::LoadSpellBonuses() uint32 count = 0; // 0 1 2 3 QueryResult *result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u spell bonus data", count); + sLog.outString(">> Loaded %u spell bonus data", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -1628,19 +1628,19 @@ void SpellMgr::LoadSpellElixirs() // 0 1 QueryResult *result = WorldDatabase.Query("SELECT entry, mask FROM spell_elixir"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u spell elixir definitions", count ); + sLog.outString(">> Loaded %u spell elixir definitions", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -1730,18 +1730,18 @@ void SpellMgr::LoadSpellThreats() // 0 1 2 3 QueryResult *result = WorldDatabase.Query("SELECT entry, Threat, multiplier, ap_bonus FROM spell_threat"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> No spell threat entries loaded."); + sLog.outString(">> No spell threat entries loaded."); return; } SpellRankHelper rankHelper(*this, mSpellThreatMap); - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -2716,11 +2716,11 @@ void SpellMgr::LoadSpellChains() QueryResult *result = WorldDatabase.Query("SELECT spell_id, prev_spell, first_spell, rank, req_spell FROM spell_chain"); if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded 0 spell chain records" ); + sLog.outString(">> Loaded 0 spell chain records"); sLog.outErrorDb("`spell_chains` table is empty!"); return; } @@ -2729,7 +2729,7 @@ void SpellMgr::LoadSpellChains() uint32 new_count = 0; uint32 req_count = 0; - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { bar.step(); @@ -2973,23 +2973,23 @@ void SpellMgr::LoadSpellLearnSkills() // search auto-learned skills and add its to map also for use in unlearn spells/talents uint32 dbc_count = 0; - barGoLink bar( sSpellStore.GetNumRows() ); - for(uint32 spell = 0; spell < sSpellStore.GetNumRows(); ++spell) + BarGoLink bar(sSpellStore.GetNumRows()); + for (uint32 spell = 0; spell < sSpellStore.GetNumRows(); ++spell) { bar.step(); SpellEntry const* entry = sSpellStore.LookupEntry(spell); - if(!entry) + if (!entry) continue; - for(int i = 0; i < MAX_EFFECT_INDEX; ++i) + for (int i = 0; i < MAX_EFFECT_INDEX; ++i) { - if(entry->Effect[i] == SPELL_EFFECT_SKILL) + if (entry->Effect[i] == SPELL_EFFECT_SKILL) { SpellLearnSkillNode dbc_node; dbc_node.skill = entry->EffectMiscValue[i]; dbc_node.step = entry->CalculateSimpleValue(SpellEffectIndex(i)); - if ( dbc_node.skill != SKILL_RIDING ) + if (dbc_node.skill != SKILL_RIDING) dbc_node.value = 1; else dbc_node.value = dbc_node.step * 75; @@ -3003,7 +3003,7 @@ void SpellMgr::LoadSpellLearnSkills() } sLog.outString(); - sLog.outString( ">> Loaded %u Spell Learn Skills from DBC", dbc_count ); + sLog.outString(">> Loaded %u Spell Learn Skills from DBC", dbc_count); } void SpellMgr::LoadSpellLearnSpells() @@ -3014,18 +3014,18 @@ void SpellMgr::LoadSpellLearnSpells() QueryResult *result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell"); if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded 0 spell learn spells" ); + sLog.outString(">> Loaded 0 spell learn spells"); sLog.outErrorDb("`spell_learn_spell` table is empty!"); return; } uint32 count = 0; - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { bar.step(); @@ -3059,7 +3059,7 @@ void SpellMgr::LoadSpellLearnSpells() mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spell_id,node)); ++count; - } while( result->NextRow() ); + } while (result->NextRow()); delete result; @@ -3126,7 +3126,7 @@ void SpellMgr::LoadSpellScriptTarget() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); @@ -3135,7 +3135,7 @@ void SpellMgr::LoadSpellScriptTarget() return; } - barGoLink bar((int)result->GetRowCount()); + BarGoLink bar(result->GetRowCount()); do { @@ -3267,19 +3267,19 @@ void SpellMgr::LoadSpellPetAuras() // 0 1 2 3 QueryResult *result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u spell pet auras", count ); + sLog.outString(">> Loaded %u spell pet auras", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -3612,18 +3612,18 @@ void SpellMgr::LoadSpellAreas() // 0 1 2 3 4 5 6 7 8 QueryResult *result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_active, quest_end, aura_spell, racemask, gender, autocast FROM spell_area"); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString( ">> Loaded %u spell area requirements", count ); + sLog.outString(">> Loaded %u spell area requirements", count); return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { @@ -3643,7 +3643,7 @@ void SpellMgr::LoadSpellAreas() spellArea.gender = Gender(fields[7].GetUInt8()); spellArea.autocast = fields[8].GetBool(); - if(!sSpellStore.LookupEntry(spell)) + if (!sSpellStore.LookupEntry(spell)) { sLog.outErrorDb("Spell %u listed in `spell_area` does not exist", spell); continue; @@ -3652,7 +3652,7 @@ void SpellMgr::LoadSpellAreas() { bool ok = true; SpellAreaMapBounds sa_bounds = GetSpellAreaMapBounds(spellArea.spellId); - for(SpellAreaMap::const_iterator itr = sa_bounds.first; itr != sa_bounds.second; ++itr) + for (SpellAreaMap::const_iterator itr = sa_bounds.first; itr != sa_bounds.second; ++itr) { if (spellArea.spellId != itr->second.spellId) continue; @@ -3672,7 +3672,7 @@ void SpellMgr::LoadSpellAreas() break; } - if(!ok) + if (!ok) { sLog.outErrorDb("Spell %u listed in `spell_area` already listed with similar requirements.", spell); continue; @@ -3680,43 +3680,43 @@ void SpellMgr::LoadSpellAreas() } - if(spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId)) + if (spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId)) { sLog.outErrorDb("Spell %u listed in `spell_area` have wrong area (%u) requirement", spell,spellArea.areaId); continue; } - if(spellArea.questStart && !sObjectMgr.GetQuestTemplate(spellArea.questStart)) + if (spellArea.questStart && !sObjectMgr.GetQuestTemplate(spellArea.questStart)) { sLog.outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart); continue; } - if(spellArea.questEnd) + if (spellArea.questEnd) { - if(!sObjectMgr.GetQuestTemplate(spellArea.questEnd)) + if (!sObjectMgr.GetQuestTemplate(spellArea.questEnd)) { sLog.outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd); continue; } - if(spellArea.questEnd==spellArea.questStart && !spellArea.questStartCanActive) + if (spellArea.questEnd==spellArea.questStart && !spellArea.questStartCanActive) { sLog.outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell,spellArea.questEnd); continue; } } - if(spellArea.auraSpell) + if (spellArea.auraSpell) { SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(spellArea.auraSpell)); - if(!spellInfo) + if (!spellInfo) { sLog.outErrorDb("Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell,abs(spellArea.auraSpell)); continue; } - switch(spellInfo->EffectApplyAuraName[EFFECT_INDEX_0]) + switch (spellInfo->EffectApplyAuraName[EFFECT_INDEX_0]) { case SPELL_AURA_DUMMY: case SPELL_AURA_PHASE: @@ -3727,7 +3727,7 @@ void SpellMgr::LoadSpellAreas() continue; } - if(uint32(abs(spellArea.auraSpell))==spellArea.spellId) + if (uint32(abs(spellArea.auraSpell))==spellArea.spellId) { sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell)); continue; @@ -3738,7 +3738,7 @@ void SpellMgr::LoadSpellAreas() { bool chain = false; SpellAreaForAuraMapBounds saBound = GetSpellAreaForAuraMapBounds(spellArea.spellId); - for(SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr) + for (SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr) { if (itr->second->autocast && itr->second->auraSpell > 0) { @@ -3754,7 +3754,7 @@ void SpellMgr::LoadSpellAreas() } SpellAreaMapBounds saBound2 = GetSpellAreaMapBounds(spellArea.auraSpell); - for(SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2) + for (SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2) { if (itr2->second.autocast && itr2->second.auraSpell > 0) { @@ -3763,7 +3763,7 @@ void SpellMgr::LoadSpellAreas() } } - if(chain) + if (chain) { sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell); continue; @@ -3771,13 +3771,13 @@ void SpellMgr::LoadSpellAreas() } } - if(spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE)==0) + if (spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE)==0) { sLog.outErrorDb("Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell,spellArea.raceMask); continue; } - if(spellArea.gender!=GENDER_NONE && spellArea.gender!=GENDER_FEMALE && spellArea.gender!=GENDER_MALE) + if (spellArea.gender!=GENDER_NONE && spellArea.gender!=GENDER_FEMALE && spellArea.gender!=GENDER_MALE) { sLog.outErrorDb("Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell,spellArea.gender); continue; @@ -3786,33 +3786,33 @@ void SpellMgr::LoadSpellAreas() SpellArea const* sa = &mSpellAreaMap.insert(SpellAreaMap::value_type(spell,spellArea))->second; // for search by current zone/subzone at zone/subzone change - if(spellArea.areaId) + if (spellArea.areaId) mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(spellArea.areaId,sa)); // for search at quest start/reward - if(spellArea.questStart) + if (spellArea.questStart) { - if(spellArea.questStartCanActive) + if (spellArea.questStartCanActive) mSpellAreaForActiveQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa)); else mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa)); } // for search at quest start/reward - if(spellArea.questEnd) + if (spellArea.questEnd) mSpellAreaForQuestEndMap.insert(SpellAreaForQuestMap::value_type(spellArea.questEnd,sa)); // for search at aura apply - if(spellArea.auraSpell) + if (spellArea.auraSpell) mSpellAreaForAuraMap.insert(SpellAreaForAuraMap::value_type(abs(spellArea.auraSpell),sa)); ++count; - } while( result->NextRow() ); + } while (result->NextRow()); delete result; sLog.outString(); - sLog.outString( ">> Loaded %u spell area requirements", count ); + sLog.outString(">> Loaded %u spell area requirements", count); } SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spellInfo, uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player) @@ -3949,7 +3949,7 @@ void SpellMgr::LoadSkillLineAbilityMap() { mSkillLineAbilityMap.clear(); - barGoLink bar( (int)sSkillLineAbilityStore.GetNumRows() ); + BarGoLink bar(sSkillLineAbilityStore.GetNumRows()); uint32 count = 0; for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i) @@ -3971,7 +3971,7 @@ void SpellMgr::LoadSkillRaceClassInfoMap() { mSkillRaceClassInfoMap.clear(); - barGoLink bar( (int)sSkillRaceClassInfoStore.GetNumRows() ); + BarGoLink bar(sSkillRaceClassInfoStore.GetNumRows()); uint32 count = 0; for (uint32 i = 0; i < sSkillRaceClassInfoStore.GetNumRows(); ++i) @@ -4002,9 +4002,9 @@ void SpellMgr::CheckUsedSpells(char const* table) // 0 1 2 3 4 5 6 7 8 9 10 11 QueryResult *result = WorldDatabase.PQuery("SELECT spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMaskB,SpellIcon,SpellVisual,SpellCategory,EffectType,EffectAura,EffectIdx,Name,Code FROM %s",table); - if( !result ) + if (!result) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); @@ -4013,7 +4013,7 @@ void SpellMgr::CheckUsedSpells(char const* table) return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp index 9e3b7e40b..3a65c3c14 100644 --- a/src/game/Transports.cpp +++ b/src/game/Transports.cpp @@ -37,7 +37,7 @@ void MapManager::LoadTransports() if( !result ) { - barGoLink bar( 1 ); + BarGoLink bar(1); bar.step(); sLog.outString(); @@ -45,7 +45,7 @@ void MapManager::LoadTransports() return; } - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp index a3caf34e5..bfdacc86d 100644 --- a/src/game/WaypointManager.cpp +++ b/src/game/WaypointManager.cpp @@ -67,7 +67,7 @@ void WaypointManager::Load() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outString( ">> Loaded 0 paths. DB table `creature_movement` is empty." ); @@ -75,7 +75,7 @@ void WaypointManager::Load() else { total_paths = (uint32)result->GetRowCount(); - barGoLink bar( total_paths ); + BarGoLink bar(total_paths); do { @@ -100,7 +100,7 @@ void WaypointManager::Load() // 7 8 9 10 11 12 13 14 15 16 "textid1, textid2, textid3, textid4, textid5, emote, spell, orientation, model1, model2 FROM creature_movement"); - barGoLink barRow((int)result->GetRowCount()); + BarGoLink barRow((int)result->GetRowCount()); // error after load, we check if creature guid corresponding to the path id has proper MovementType std::set creatureNoMoveType; @@ -243,7 +243,7 @@ void WaypointManager::Load() if (!result) { - barGoLink bar(1); + BarGoLink bar(1); bar.step(); sLog.outString(); sLog.outString( ">> Loaded 0 path templates. DB table `creature_movement_template` is empty." ); @@ -253,7 +253,7 @@ void WaypointManager::Load() total_nodes = 0; total_behaviors = 0; total_paths = (uint32)result->GetRowCount(); - barGoLink barRow(total_paths); + BarGoLink barRow(total_paths); do { @@ -278,7 +278,7 @@ void WaypointManager::Load() // 7 8 9 10 11 12 13 14 15 16 "textid1, textid2, textid3, textid4, textid5, emote, spell, orientation, model1, model2 FROM creature_movement_template"); - barGoLink bar( (int)result->GetRowCount() ); + BarGoLink bar(result->GetRowCount()); do { diff --git a/src/mangosd/Main.cpp b/src/mangosd/Main.cpp index fee8ac557..95d4ff8cf 100644 --- a/src/mangosd/Main.cpp +++ b/src/mangosd/Main.cpp @@ -200,7 +200,7 @@ extern int main(int argc, char **argv) DETAIL_LOG("Using ACE: %s", ACE_VERSION); ///- Set progress bars show mode - barGoLink::SetOutputState(sConfig.GetBoolDefault("ShowProgressBars", true)); + BarGoLink::SetOutputState(sConfig.GetBoolDefault("ShowProgressBars", true)); ///- and run the 'Master' /// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd? diff --git a/src/shared/Database/SQLStorageImpl.h b/src/shared/Database/SQLStorageImpl.h index 62625c583..fa02eda7d 100644 --- a/src/shared/Database/SQLStorageImpl.h +++ b/src/shared/Database/SQLStorageImpl.h @@ -223,8 +223,8 @@ void SQLStorageLoaderBase::Load(SQLStorage &store, bool error_at_empty /*= tr memset(newIndex,0,maxi*sizeof(char*)); char * _data= new char[store.RecordCount *recordsize]; - uint32 count=0; - barGoLink bar( store.RecordCount ); + uint32 count = 0; + BarGoLink bar(store.RecordCount); do { fields = result->Fetch(); diff --git a/src/shared/Log.cpp b/src/shared/Log.cpp index 724d093f7..a13680c17 100644 --- a/src/shared/Log.cpp +++ b/src/shared/Log.cpp @@ -860,7 +860,7 @@ void Log::WaitBeforeContinueIfNeed() else if (mode > 0) { printf("\nWait %u secs for continue.\n",mode); - barGoLink bar(mode); + BarGoLink bar(mode); for(int i = 0; i < mode; ++i) { bar.step(); diff --git a/src/shared/ProgressBar.cpp b/src/shared/ProgressBar.cpp index cd28c3dfd..b97e141b7 100644 --- a/src/shared/ProgressBar.cpp +++ b/src/shared/ProgressBar.cpp @@ -19,17 +19,35 @@ #include #include "ProgressBar.h" +#include "Errors.h" -bool barGoLink::m_showOutput = true; +bool BarGoLink::m_showOutput = true; -char const* const barGoLink::empty = " "; +char const* const BarGoLink::empty = " "; #ifdef _WIN32 -char const* const barGoLink::full = "\x3D"; +char const* const BarGoLink::full = "\x3D"; #else -char const* const barGoLink::full = "*"; +char const* const BarGoLink::full = "*"; #endif -barGoLink::~barGoLink() +BarGoLink::BarGoLink(int row_count) +{ + init(row_count); +} + +BarGoLink::BarGoLink(uint32 row_count) +{ + MANGOS_ASSERT(row_count < (uint32)ACE_INT32_MAX); + init((int)row_count); +} + +BarGoLink::BarGoLink(uint64 row_count) +{ + MANGOS_ASSERT(row_count < (uint64)ACE_INT32_MAX); + init((int)row_count); +} + +BarGoLink::~BarGoLink() { if (!m_showOutput) return; @@ -38,7 +56,7 @@ barGoLink::~barGoLink() fflush(stdout); } -barGoLink::barGoLink(int row_count) +void BarGoLink::init(int row_count) { rec_no = 0; rec_pos = 0; @@ -62,7 +80,7 @@ barGoLink::barGoLink(int row_count) fflush(stdout); } -void barGoLink::step() +void BarGoLink::step() { if (!m_showOutput) return; @@ -94,7 +112,7 @@ void barGoLink::step() } // avoid use inline version because linking problems with private static field -void barGoLink::SetOutputState(bool on) +void BarGoLink::SetOutputState(bool on) { m_showOutput = on; -} \ No newline at end of file +} diff --git a/src/shared/ProgressBar.h b/src/shared/ProgressBar.h index 195b0b0ba..c2f142fa4 100644 --- a/src/shared/ProgressBar.h +++ b/src/shared/ProgressBar.h @@ -20,17 +20,21 @@ #include "Platform/Define.h" -class MANGOS_DLL_SPEC barGoLink +class MANGOS_DLL_SPEC BarGoLink { public: // constructors - barGoLink(int row_count); - ~barGoLink(); + explicit BarGoLink(int row_count); + explicit BarGoLink(uint32 row_count); // row_count < ACE_INT32_MAX + explicit BarGoLink(uint64 row_count); // row_count < ACE_INT32_MAX + ~BarGoLink(); public: // modifiers - void step( void ); + void step(); static void SetOutputState(bool on); private: + void init(int row_count); + static bool m_showOutput; // not recommended change with existed active bar static char const * const empty; static char const * const full; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 760399677..90e712cb9 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 "11589" + #define REVISION_NR "11590" #endif // __REVISION_NR_H__