mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 16:37:06 +00:00
Apply style fix pt5
This commit is contained in:
parent
4727d8846f
commit
1a1110b4f7
67 changed files with 648 additions and 214 deletions
|
|
@ -79,7 +79,9 @@ bool normalizePlayerName(std::string& name)
|
|||
|
||||
wstr_buf[0] = wcharToUpper(wstr_buf[0]);
|
||||
for (size_t i = 1; i < wstr_len; ++i)
|
||||
{ wstr_buf[i] = wcharToLower(wstr_buf[i]); }
|
||||
{
|
||||
wstr_buf[i] = wcharToLower(wstr_buf[i]);
|
||||
}
|
||||
|
||||
if (!WStrToUtf8(wstr_buf, wstr_len, name))
|
||||
{
|
||||
|
|
@ -185,18 +187,26 @@ ObjectMgr::ObjectMgr() :
|
|||
ObjectMgr::~ObjectMgr()
|
||||
{
|
||||
for (QuestMap::iterator i = mQuestTemplates.begin(); i != mQuestTemplates.end(); ++i)
|
||||
{ delete i->second; }
|
||||
{
|
||||
delete i->second;
|
||||
}
|
||||
|
||||
for (PetLevelInfoMap::iterator i = petInfo.begin(); i != petInfo.end(); ++i)
|
||||
{ delete[] i->second; }
|
||||
{
|
||||
delete[] i->second;
|
||||
}
|
||||
|
||||
for (int race = 0; race < MAX_RACES; ++race)
|
||||
for (int class_ = 0; class_ < MAX_CLASSES; ++class_)
|
||||
{ delete[] playerInfo[race][class_].levelInfo; }
|
||||
{
|
||||
delete[] playerInfo[race][class_].levelInfo;
|
||||
}
|
||||
|
||||
// free objects
|
||||
for (GroupMap::iterator itr = mGroupMap.begin(); itr != mGroupMap.end(); ++itr)
|
||||
{ delete itr->second; }
|
||||
{
|
||||
delete itr->second;
|
||||
}
|
||||
|
||||
for (ArenaTeamMap::iterator itr = mArenaTeamMap.begin(); itr != mArenaTeamMap.end(); ++itr)
|
||||
{
|
||||
|
|
@ -204,13 +214,19 @@ ObjectMgr::~ObjectMgr()
|
|||
}
|
||||
|
||||
for (CacheVendorItemMap::iterator itr = m_mCacheVendorTemplateItemMap.begin(); itr != m_mCacheVendorTemplateItemMap.end(); ++itr)
|
||||
{ itr->second.Clear(); }
|
||||
{
|
||||
itr->second.Clear();
|
||||
}
|
||||
|
||||
for (CacheVendorItemMap::iterator itr = m_mCacheVendorItemMap.begin(); itr != m_mCacheVendorItemMap.end(); ++itr)
|
||||
{ itr->second.Clear(); }
|
||||
{
|
||||
itr->second.Clear();
|
||||
}
|
||||
|
||||
for (CacheTrainerSpellMap::iterator itr = m_mCacheTrainerSpellMap.begin(); itr != m_mCacheTrainerSpellMap.end(); ++itr)
|
||||
{ itr->second.Clear(); }
|
||||
{
|
||||
itr->second.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
Group* ObjectMgr::GetGroupById(uint32 id) const
|
||||
|
|
@ -2699,7 +2715,9 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
}
|
||||
|
||||
for (std::set<uint32>::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr)
|
||||
{ sLog.outErrorDb("Item (Entry: %u) not exist in `item_template` but referenced in `CharStartOutfit.dbc`", *itr); }
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not exist in `item_template` but referenced in `CharStartOutfit.dbc`", *itr);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadItemConverts()
|
||||
|
|
@ -3416,7 +3434,9 @@ void ObjectMgr::LoadPlayerInfo()
|
|||
PlayerLevelInfo* pLevelInfo = &pInfo->levelInfo[current_level - 1];
|
||||
|
||||
for (int i = 0; i < MAX_STATS; ++i)
|
||||
{ pLevelInfo->stats[i] = fields[i + 3].GetUInt8(); }
|
||||
{
|
||||
pLevelInfo->stats[i] = fields[i + 3].GetUInt8();
|
||||
}
|
||||
|
||||
bar.step();
|
||||
++count;
|
||||
|
|
@ -3490,7 +3510,9 @@ void ObjectMgr::LoadPlayerInfo()
|
|||
{
|
||||
mPlayerXPperLevel.resize(sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL));
|
||||
for (uint32 level = 0; level < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL); ++level)
|
||||
{ mPlayerXPperLevel[level] = 0; }
|
||||
{
|
||||
mPlayerXPperLevel[level] = 0;
|
||||
}
|
||||
|
||||
// 0 1
|
||||
QueryResult* result = WorldDatabase.Query("SELECT lvl, xp_for_next_level FROM player_xp_for_level");
|
||||
|
|
@ -3930,7 +3952,9 @@ void ObjectMgr::LoadQuests()
|
|||
{
|
||||
// For reload case
|
||||
for (QuestMap::const_iterator itr = mQuestTemplates.begin(); itr != mQuestTemplates.end(); ++itr)
|
||||
{ delete itr->second; }
|
||||
{
|
||||
delete itr->second;
|
||||
}
|
||||
|
||||
mQuestTemplates.clear();
|
||||
|
||||
|
|
@ -5040,7 +5064,9 @@ void ObjectMgr::LoadPageTexts()
|
|||
std::ostringstream ss;
|
||||
ss << "The text page(s) ";
|
||||
for (std::set<uint32>::iterator itr = checkedPages.begin(); itr != checkedPages.end(); ++itr)
|
||||
{ ss << *itr << " "; }
|
||||
{
|
||||
ss << *itr << " ";
|
||||
}
|
||||
ss << "create(s) a circular reference, which can cause the server to freeze. Changing Next_Page of page "
|
||||
<< pageItr->Page_ID << " to 0";
|
||||
sLog.outErrorDb("%s", ss.str().c_str());
|
||||
|
|
@ -5548,7 +5574,9 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
|||
{
|
||||
// mail open and then not returned
|
||||
for (MailItemInfoVec::iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2)
|
||||
{ CharacterDatabase.PExecute("DELETE FROM item_instance WHERE guid = '%u'", itr2->item_guid); }
|
||||
{
|
||||
CharacterDatabase.PExecute("DELETE FROM item_instance WHERE guid = '%u'", itr2->item_guid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -9763,7 +9791,9 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates)
|
|||
|
||||
// For reload case
|
||||
for (CacheTrainerSpellMap::iterator itr = trainerList.begin(); itr != trainerList.end(); ++itr)
|
||||
{ itr->second.Clear(); }
|
||||
{
|
||||
itr->second.Clear();
|
||||
}
|
||||
trainerList.clear();
|
||||
|
||||
std::set<uint32> skip_trainers;
|
||||
|
|
@ -9932,7 +9962,9 @@ void ObjectMgr::LoadTrainerTemplates()
|
|||
bool hasErrored = false;
|
||||
|
||||
for (CacheTrainerSpellMap::const_iterator tItr = m_mCacheTrainerTemplateSpellMap.begin(); tItr != m_mCacheTrainerTemplateSpellMap.end(); ++tItr)
|
||||
{ trainer_ids.insert(tItr->first); }
|
||||
{
|
||||
trainer_ids.insert(tItr->first);
|
||||
}
|
||||
|
||||
for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i)
|
||||
{
|
||||
|
|
@ -9954,7 +9986,9 @@ void ObjectMgr::LoadTrainerTemplates()
|
|||
}
|
||||
|
||||
for (std::set<uint32>::const_iterator tItr = trainer_ids.begin(); tItr != trainer_ids.end(); ++tItr)
|
||||
{ sLog.outErrorDb("Table `npc_trainer_template` has trainer template %u not used by any trainers ", *tItr); }
|
||||
{
|
||||
sLog.outErrorDb("Table `npc_trainer_template` has trainer template %u not used by any trainers ", *tItr);
|
||||
}
|
||||
|
||||
if (hasErrored || !trainer_ids.empty()) // Append extra line in case of reported errors
|
||||
{
|
||||
|
|
@ -9968,7 +10002,9 @@ void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates)
|
|||
|
||||
// For reload case
|
||||
for (CacheVendorItemMap::iterator itr = vendorList.begin(); itr != vendorList.end(); ++itr)
|
||||
{ itr->second.Clear(); }
|
||||
{
|
||||
itr->second.Clear();
|
||||
}
|
||||
vendorList.clear();
|
||||
|
||||
std::set<uint32> skip_vendors;
|
||||
|
|
@ -10027,7 +10063,9 @@ void ObjectMgr::LoadVendorTemplates()
|
|||
std::set<uint32> vendor_ids;
|
||||
|
||||
for (CacheVendorItemMap::const_iterator vItr = m_mCacheVendorTemplateItemMap.begin(); vItr != m_mCacheVendorTemplateItemMap.end(); ++vItr)
|
||||
{ vendor_ids.insert(vItr->first); }
|
||||
{
|
||||
vendor_ids.insert(vItr->first);
|
||||
}
|
||||
|
||||
for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i)
|
||||
{
|
||||
|
|
@ -10046,7 +10084,9 @@ void ObjectMgr::LoadVendorTemplates()
|
|||
}
|
||||
|
||||
for (std::set<uint32>::const_iterator vItr = vendor_ids.begin(); vItr != vendor_ids.end(); ++vItr)
|
||||
{ sLog.outErrorDb("Table `npc_vendor_template` has vendor template %u not used by any vendors ", *vItr); }
|
||||
{
|
||||
sLog.outErrorDb("Table `npc_vendor_template` has vendor template %u not used by any vendors ", *vItr);
|
||||
}
|
||||
}
|
||||
|
||||
/* This function is supposed to take care of three things:
|
||||
|
|
@ -10381,7 +10421,9 @@ void ObjectMgr::LoadGossipMenuItems(std::set<uint32>& gossipScriptSet)
|
|||
if (!sLog.HasLogFilter(LOG_FILTER_DB_STRICTED_CHECK))
|
||||
{
|
||||
for (std::set<uint32>::const_iterator itr = menu_ids.begin(); itr != menu_ids.end(); ++itr)
|
||||
{ sLog.outErrorDb("Table `gossip_menu` contain unused (in creature or GO or menu options) menu id %u.", *itr); }
|
||||
{
|
||||
sLog.outErrorDb("Table `gossip_menu` contain unused (in creature or GO or menu options) menu id %u.", *itr);
|
||||
}
|
||||
}
|
||||
|
||||
sLog.outString(">> Loaded %u gossip_menu_option entries", count);
|
||||
|
|
@ -10399,7 +10441,9 @@ void ObjectMgr::LoadGossipMenus()
|
|||
// Check which script-ids in db_scripts type DBS_ON_GOSSIP are not used
|
||||
std::set<uint32> gossipScriptSet;
|
||||
for (ScriptChainMap::const_iterator itr = scm->begin(); itr != scm->end(); ++itr)
|
||||
{ gossipScriptSet.insert(itr->first); }
|
||||
{
|
||||
gossipScriptSet.insert(itr->first);
|
||||
}
|
||||
|
||||
// Load gossip_menu and gossip_menu_option data
|
||||
sLog.outString("(Re)Loading Gossip menus...");
|
||||
|
|
@ -10408,7 +10452,9 @@ void ObjectMgr::LoadGossipMenus()
|
|||
LoadGossipMenuItems(gossipScriptSet);
|
||||
|
||||
for (std::set<uint32>::const_iterator itr = gossipScriptSet.begin(); itr != gossipScriptSet.end(); ++itr)
|
||||
{ sLog.outErrorDb("Table `db_scripts [type = %d]` contains unused script, id %u.", DBS_ON_GOSSIP, *itr); }
|
||||
{
|
||||
sLog.outErrorDb("Table `db_scripts [type = %d]` contains unused script, id %u.", DBS_ON_GOSSIP, *itr);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, uint8 type, uint32 maxcount, uint32 incrtime, uint32 extendedcost)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue