mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
refactor(Core): Clean (#22583)
This commit is contained in:
@@ -155,7 +155,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, CharacterDatabas
|
||||
}
|
||||
}
|
||||
else
|
||||
sAuctionMgr->RemoveAItem(auction->item_guid, true, &trans);
|
||||
RemoveAItem(auction->item_guid, true, &trans);
|
||||
}
|
||||
|
||||
void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry* auction, CharacterDatabaseTransaction trans, bool sendMail)
|
||||
@@ -256,7 +256,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, CharacterDat
|
||||
}
|
||||
}
|
||||
else
|
||||
sAuctionMgr->RemoveAItem(auction->item_guid, true, &trans);
|
||||
RemoveAItem(auction->item_guid, true, &trans);
|
||||
}
|
||||
|
||||
//this function sends mail to old bidder
|
||||
|
||||
@@ -1934,7 +1934,7 @@ void GameEventMgr::SetHolidayEventTime(GameEventData& event)
|
||||
|
||||
uint32 GameEventMgr::GetHolidayEventId(uint32 holidayId) const
|
||||
{
|
||||
auto const& events = sGameEventMgr->GetEventMap();
|
||||
auto const& events = GetEventMap();
|
||||
|
||||
for (auto const& eventEntry : events)
|
||||
{
|
||||
|
||||
@@ -871,7 +871,7 @@ void ObjectMgr::LoadCreatureTemplateAddons()
|
||||
|
||||
uint32 entry = fields[0].Get<uint32>();
|
||||
|
||||
if (!sObjectMgr->GetCreatureTemplate(entry))
|
||||
if (!GetCreatureTemplate(entry))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Creature template (Entry: {}) does not exist but has a record in `creature_template_addon`", entry);
|
||||
continue;
|
||||
@@ -1501,7 +1501,7 @@ void ObjectMgr::LoadEquipmentTemplates()
|
||||
|
||||
uint32 entry = fields[0].Get<uint32>();
|
||||
|
||||
if (!sObjectMgr->GetCreatureTemplate(entry))
|
||||
if (!GetCreatureTemplate(entry))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Creature template (CreatureID: {}) does not exist but has a record in `creature_equip_template`", entry);
|
||||
continue;
|
||||
@@ -2455,7 +2455,7 @@ void ObjectMgr::LoadCreatureSparring()
|
||||
ObjectGuid::LowType spawnId = fields[0].Get<uint32>();
|
||||
float sparringHealthPct = fields[1].Get<float>();
|
||||
|
||||
if (!sObjectMgr->GetCreatureData(spawnId))
|
||||
if (!GetCreatureData(spawnId))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Entry {} has a record in `creature_sparring` but doesn't exist in `creatures` table");
|
||||
continue;
|
||||
@@ -2535,7 +2535,7 @@ ObjectGuid::LowType ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, fl
|
||||
// We use spawn coords to spawn
|
||||
if (!map->Instanceable() && map->IsGridLoaded(x, y))
|
||||
{
|
||||
GameObject* go = sObjectMgr->IsGameObjectStaticTransport(data.id) ? new StaticTransport() : new GameObject();
|
||||
GameObject* go = IsGameObjectStaticTransport(data.id) ? new StaticTransport() : new GameObject();
|
||||
if (!go->LoadGameObjectFromDB(spawnId, map))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "AddGOData: cannot add gameobject entry {} to map", entry);
|
||||
@@ -3012,7 +3012,7 @@ void ObjectMgr::LoadItemTemplates()
|
||||
itemTemplate.Duration = fields[129].Get<uint32>();
|
||||
itemTemplate.ItemLimitCategory = uint32(fields[130].Get<int16>());
|
||||
itemTemplate.HolidayId = fields[131].Get<uint32>();
|
||||
itemTemplate.ScriptId = sObjectMgr->GetScriptId(fields[132].Get<std::string>());
|
||||
itemTemplate.ScriptId = GetScriptId(fields[132].Get<std::string>());
|
||||
itemTemplate.DisenchantID = fields[133].Get<uint32>();
|
||||
itemTemplate.FoodType = uint32(fields[134].Get<uint8>());
|
||||
itemTemplate.MinMoneyLoot = fields[135].Get<uint32>();
|
||||
@@ -3570,7 +3570,7 @@ void ObjectMgr::LoadItemSetNames()
|
||||
{
|
||||
uint32 entry = *itr;
|
||||
// add data from item_template if available
|
||||
pProto = sObjectMgr->GetItemTemplate(entry);
|
||||
pProto = GetItemTemplate(entry);
|
||||
if (pProto)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Item set part (Entry: {}) does not have entry in `item_set_names`, adding data from `item_template`.", entry);
|
||||
@@ -3617,13 +3617,13 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
|
||||
uint8 uiSummonType = fields[4].Get<uint8>();
|
||||
uint32 uiSummonTimer = fields[5].Get<uint32>();
|
||||
|
||||
if (!sObjectMgr->GetCreatureTemplate(uiEntry))
|
||||
if (!GetCreatureTemplate(uiEntry))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `vehicle_template_accessory`: creature template entry {} does not exist.", uiEntry);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!sObjectMgr->GetCreatureTemplate(uiAccessory))
|
||||
if (!GetCreatureTemplate(uiAccessory))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `vehicle_template_accessory`: Accessory {} does not exist.", uiAccessory);
|
||||
continue;
|
||||
@@ -3673,7 +3673,7 @@ void ObjectMgr::LoadVehicleAccessories()
|
||||
uint8 uiSummonType = fields[4].Get<uint8>();
|
||||
uint32 uiSummonTimer = fields[5].Get<uint32>();
|
||||
|
||||
if (!sObjectMgr->GetCreatureTemplate(uiAccessory))
|
||||
if (!GetCreatureTemplate(uiAccessory))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `vehicle_accessory`: Accessory {} does not exist.", uiAccessory);
|
||||
continue;
|
||||
@@ -3765,7 +3765,7 @@ void ObjectMgr::LoadPetLevelInfo()
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 creature_id = fields[0].Get<uint32>();
|
||||
if (!sObjectMgr->GetCreatureTemplate(creature_id))
|
||||
if (!GetCreatureTemplate(creature_id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Wrong creature id {} in `pet_levelstats` table, ignoring.", creature_id);
|
||||
continue;
|
||||
@@ -4998,7 +4998,7 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
if (qinfo->StartItem)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(qinfo->StartItem))
|
||||
if (!GetItemTemplate(qinfo->StartItem))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Quest {} has `StartItem` = {} but item with entry {} does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), qinfo->StartItem, qinfo->StartItem);
|
||||
@@ -5049,7 +5049,7 @@ void ObjectMgr::LoadQuests()
|
||||
|
||||
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER);
|
||||
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
if (!GetItemTemplate(id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Quest {} has `RequiredItemId{}` = {} but item with entry {} does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), j + 1, id, id);
|
||||
@@ -5069,7 +5069,7 @@ void ObjectMgr::LoadQuests()
|
||||
uint32 id = qinfo->ItemDrop[j];
|
||||
if (id)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
if (!GetItemTemplate(id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Quest {} has `ItemDrop{}` = {} but item with entry {} does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), j + 1, id, id);
|
||||
@@ -5090,14 +5090,14 @@ void ObjectMgr::LoadQuests()
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
|
||||
{
|
||||
int32 id = qinfo->RequiredNpcOrGo[j];
|
||||
if (id < 0 && !sObjectMgr->GetGameObjectTemplate(-id))
|
||||
if (id < 0 && !GetGameObjectTemplate(-id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Quest {} has `RequiredNpcOrGo{}` = {} but gameobject {} does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), j + 1, id, uint32(-id));
|
||||
qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (id > 0 && !sObjectMgr->GetCreatureTemplate(id))
|
||||
if (id > 0 && !GetCreatureTemplate(id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Quest {} has `RequiredNpcOrGo{}` = {} but creature with entry {} does not exist, quest can't be done.",
|
||||
qinfo->GetQuestId(), j + 1, id, uint32(id));
|
||||
@@ -5130,7 +5130,7 @@ void ObjectMgr::LoadQuests()
|
||||
uint32 id = qinfo->RewardChoiceItemId[j];
|
||||
if (id)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
if (!GetItemTemplate(id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Quest {} has `RewardChoiceItemId{}` = {} but item with entry {} does not exist, quest will not reward this item.",
|
||||
qinfo->GetQuestId(), j + 1, id, id);
|
||||
@@ -5176,7 +5176,7 @@ void ObjectMgr::LoadQuests()
|
||||
uint32 id = qinfo->RewardItemId[j];
|
||||
if (id)
|
||||
{
|
||||
if (!sObjectMgr->GetItemTemplate(id))
|
||||
if (!GetItemTemplate(id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Quest {} has `RewardItemId{}` = {} but item with entry {} does not exist, quest will not reward this item.",
|
||||
qinfo->GetQuestId(), j + 1, id, id);
|
||||
@@ -5760,7 +5760,7 @@ void ObjectMgr::LoadEventScripts()
|
||||
|
||||
std::set<uint32> evt_scripts;
|
||||
// Load all possible script entries from gameobjects
|
||||
GameObjectTemplateContainer const* gotc = sObjectMgr->GetGameObjectTemplates();
|
||||
GameObjectTemplateContainer const* gotc = GetGameObjectTemplates();
|
||||
for (GameObjectTemplateContainer::const_iterator itr = gotc->begin(); itr != gotc->end(); ++itr)
|
||||
if (uint32 eventId = itr->second.GetEventScriptId())
|
||||
evt_scripts.insert(eventId);
|
||||
@@ -6069,7 +6069,7 @@ void ObjectMgr::LoadInstanceTemplate()
|
||||
|
||||
instanceTemplate.AllowMount = fields[3].Get<bool>();
|
||||
instanceTemplate.Parent = uint32(fields[1].Get<uint16>());
|
||||
instanceTemplate.ScriptId = sObjectMgr->GetScriptId(fields[2].Get<std::string>());
|
||||
instanceTemplate.ScriptId = GetScriptId(fields[2].Get<std::string>());
|
||||
|
||||
_instanceTemplateStore[mapID] = instanceTemplate;
|
||||
|
||||
@@ -6515,14 +6515,14 @@ void ObjectMgr::LoadQuestGreetings()
|
||||
switch (type)
|
||||
{
|
||||
case 0: // Creature
|
||||
if (!sObjectMgr->GetCreatureTemplate(id))
|
||||
if (!GetCreatureTemplate(id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `quest_greeting`: creature template entry {} does not exist.", id);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case 1: // GameObject
|
||||
if (!sObjectMgr->GetGameObjectTemplate(id))
|
||||
if (!GetGameObjectTemplate(id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `quest_greeting`: gameobject template entry {} does not exist.", id);
|
||||
continue;
|
||||
@@ -6568,14 +6568,14 @@ void ObjectMgr::LoadQuestGreetingsLocales()
|
||||
switch (type)
|
||||
{
|
||||
case 0: // Creature
|
||||
if (!sObjectMgr->GetCreatureTemplate(id))
|
||||
if (!GetCreatureTemplate(id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `quest_greeting_locale`: creature template entry {} does not exist.", id);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case 1: // GameObject
|
||||
if (!sObjectMgr->GetGameObjectTemplate(id))
|
||||
if (!GetGameObjectTemplate(id))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `quest_greeting_locale`: gameobject template entry {} does not exist.", id);
|
||||
continue;
|
||||
@@ -7577,7 +7577,7 @@ void ObjectMgr::LoadGameObjectTemplateAddons()
|
||||
|
||||
uint32 entry = fields[0].Get<uint32>();
|
||||
|
||||
GameObjectTemplate const* got = sObjectMgr->GetGameObjectTemplate(entry);
|
||||
GameObjectTemplate const* got = GetGameObjectTemplate(entry);
|
||||
if (!got)
|
||||
{
|
||||
LOG_ERROR("sql.sql",
|
||||
@@ -8222,7 +8222,7 @@ void ObjectMgr::LoadNPCSpellClickSpells()
|
||||
|
||||
// all spellclick data loaded, now we check if there are creatures with NPC_FLAG_SPELLCLICK but with no data
|
||||
// NOTE: It *CAN* be the other way around: no spellclick flag but with spellclick data, in case of creature-only vehicle accessories
|
||||
CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates();
|
||||
CreatureTemplateContainer const* ctc = GetCreatureTemplates();
|
||||
for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr)
|
||||
{
|
||||
if ((itr->second.npcflag & UNIT_NPC_FLAG_SPELLCLICK) && _spellClickInfoStore.find(itr->second.Entry) == _spellClickInfoStore.end())
|
||||
@@ -8747,7 +8747,7 @@ void ObjectMgr::LoadGameObjectForQuests()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
if (sObjectMgr->GetGameObjectTemplates()->empty())
|
||||
if (GetGameObjectTemplates()->empty())
|
||||
{
|
||||
LOG_WARN("server.loading", ">> Loaded 0 GameObjects for quests");
|
||||
LOG_INFO("server.loading", " ");
|
||||
@@ -8757,7 +8757,7 @@ void ObjectMgr::LoadGameObjectForQuests()
|
||||
uint32 count = 0;
|
||||
|
||||
// collect GO entries for GO that must activated
|
||||
GameObjectTemplateContainer* gotc = const_cast<GameObjectTemplateContainer*>(sObjectMgr->GetGameObjectTemplates());
|
||||
GameObjectTemplateContainer* gotc = const_cast<GameObjectTemplateContainer*>(GetGameObjectTemplates());
|
||||
for (GameObjectTemplateContainer::iterator itr = gotc->begin(); itr != gotc->end(); ++itr)
|
||||
{
|
||||
itr->second.IsForQuests = false;
|
||||
@@ -9666,7 +9666,7 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool persist /*= tru
|
||||
bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* player, std::set<uint32>* /*skip_vendors*/, uint32 /*ORnpcflag*/) const
|
||||
{
|
||||
/*
|
||||
CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(vendor_entry);
|
||||
CreatureTemplate const* cInfo = GetCreatureTemplate(vendor_entry);
|
||||
if (!cInfo)
|
||||
{
|
||||
if (player)
|
||||
@@ -10040,7 +10040,7 @@ void ObjectMgr::LoadCreatureClassLevelStats()
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates();
|
||||
CreatureTemplateContainer const* ctc = GetCreatureTemplates();
|
||||
for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr)
|
||||
{
|
||||
for (uint16 lvl = itr->second.minlevel; lvl <= itr->second.maxlevel; ++lvl)
|
||||
@@ -10148,9 +10148,9 @@ void ObjectMgr::LoadFactionChangeQuests()
|
||||
uint32 alliance = fields[0].Get<uint32>();
|
||||
uint32 horde = fields[1].Get<uint32>();
|
||||
|
||||
if (!sObjectMgr->GetQuestTemplate(alliance))
|
||||
if (!GetQuestTemplate(alliance))
|
||||
LOG_ERROR("sql.sql", "Quest {} (alliance_id) referenced in `player_factionchange_quests` does not exist, pair skipped!", alliance);
|
||||
else if (!sObjectMgr->GetQuestTemplate(horde))
|
||||
else if (!GetQuestTemplate(horde))
|
||||
LOG_ERROR("sql.sql", "Quest {} (horde_id) referenced in `player_factionchange_quests` does not exist, pair skipped!", horde);
|
||||
else
|
||||
FactionChangeQuests[alliance] = horde;
|
||||
|
||||
@@ -223,7 +223,7 @@ Map::EnterState MapMgr::PlayerCannotEnter(uint32 mapid, Player* player, bool log
|
||||
{
|
||||
uint32 destInstId = sInstanceSaveMgr->PlayerGetDestinationInstanceId(player, mapid, targetDifficulty);
|
||||
if (destInstId)
|
||||
if (Map* boundMap = sMapMgr->FindMap(mapid, destInstId))
|
||||
if (Map* boundMap = FindMap(mapid, destInstId))
|
||||
if (Map::EnterState denyReason = boundMap->CannotEnter(player, loginCheck))
|
||||
return denyReason;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ GraveyardStruct const* Graveyard::GetDefaultGraveyard(TeamId teamId)
|
||||
ALLIANCE_GRAVEYARD = 4, // Westfall
|
||||
};
|
||||
|
||||
return sGraveyard->GetGraveyard(teamId == TEAM_HORDE ? HORDE_GRAVEYARD : ALLIANCE_GRAVEYARD);
|
||||
return GetGraveyard(teamId == TEAM_HORDE ? HORDE_GRAVEYARD : ALLIANCE_GRAVEYARD);
|
||||
}
|
||||
|
||||
GraveyardStruct const* Graveyard::GetClosestGraveyard(Player* player, TeamId teamId, bool nearCorpse)
|
||||
@@ -100,7 +100,7 @@ GraveyardStruct const* Graveyard::GetClosestGraveyard(Player* player, TeamId tea
|
||||
sScriptMgr->OnPlayerBeforeChooseGraveyard(player, teamId, nearCorpse, graveyardOverride);
|
||||
if (graveyardOverride)
|
||||
{
|
||||
return sGraveyard->GetGraveyard(graveyardOverride);
|
||||
return GetGraveyard(graveyardOverride);
|
||||
}
|
||||
|
||||
WorldLocation loc = player->GetWorldLocation();
|
||||
@@ -182,7 +182,7 @@ GraveyardStruct const* Graveyard::GetClosestGraveyard(Player* player, TeamId tea
|
||||
for (; range.first != range.second; ++range.first)
|
||||
{
|
||||
GraveyardData const& graveyardLink = range.first->second;
|
||||
GraveyardStruct const* entry = sGraveyard->GetGraveyard(graveyardLink.safeLocId);
|
||||
GraveyardStruct const* entry = GetGraveyard(graveyardLink.safeLocId);
|
||||
if (!entry)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `graveyard_zone` has record for not existing `game_graveyard` table {}, skipped.", graveyardLink.safeLocId);
|
||||
@@ -388,7 +388,7 @@ void Graveyard::LoadGraveyardZones()
|
||||
uint32 team = fields[2].Get<uint16>();
|
||||
TeamId teamId = team == 0 ? TEAM_NEUTRAL : (team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE);
|
||||
|
||||
GraveyardStruct const* entry = sGraveyard->GetGraveyard(safeLocId);
|
||||
GraveyardStruct const* entry = GetGraveyard(safeLocId);
|
||||
if (!entry)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `graveyard_zone` has a record for not existing `game_graveyard` table {}, skipped.", safeLocId);
|
||||
|
||||
@@ -1614,7 +1614,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellTargetPosition(i))
|
||||
if (!GetSpellTargetPosition(i))
|
||||
LOG_DEBUG("spells.aura", "Spell (ID: {}) does not have record in `spell_target_position`", i);
|
||||
}
|
||||
}*/
|
||||
@@ -2348,7 +2348,7 @@ void SpellMgr::LoadPetLevelupSpellMap()
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
bool LoadPetDefaultSpells_helper(CreatureTemplate const* cInfo, PetDefaultSpellsEntry& petDefSpells)
|
||||
static bool LoadPetDefaultSpells_helper(CreatureTemplate const* cInfo, PetDefaultSpellsEntry& petDefSpells)
|
||||
{
|
||||
// skip empty list;
|
||||
bool have_spell = false;
|
||||
@@ -3448,9 +3448,9 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
|
||||
|
||||
spellInfo->_InitializeExplicitTargetMask();
|
||||
|
||||
if (sSpellMgr->HasSpellCooldownOverride(spellInfo->Id))
|
||||
if (HasSpellCooldownOverride(spellInfo->Id))
|
||||
{
|
||||
SpellCooldownOverride spellOverride = sSpellMgr->GetSpellCooldownOverride(spellInfo->Id);
|
||||
SpellCooldownOverride spellOverride = GetSpellCooldownOverride(spellInfo->Id);
|
||||
|
||||
if (spellInfo->RecoveryTime != spellOverride.RecoveryTime)
|
||||
{
|
||||
@@ -3497,7 +3497,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
|
||||
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
|
||||
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT:
|
||||
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
|
||||
if (SpellInfo const* triggerSpell = sSpellMgr->GetSpellInfo(spellInfo->Effects[j].TriggerSpell))
|
||||
if (SpellInfo const* triggerSpell = GetSpellInfo(spellInfo->Effects[j].TriggerSpell))
|
||||
{
|
||||
overrideAttr = true;
|
||||
if (triggerSpell->AttributesCu & SPELL_ATTR0_CU_BINARY_SPELL)
|
||||
|
||||
@@ -286,7 +286,7 @@ void TicketMgr::ResetTickets()
|
||||
{
|
||||
uint32 ticketId = itr->second->GetId();
|
||||
++itr;
|
||||
sTicketMgr->RemoveTicket(ticketId);
|
||||
RemoveTicket(ticketId);
|
||||
}
|
||||
else
|
||||
++itr;
|
||||
|
||||
@@ -217,10 +217,10 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
//visibility on continents
|
||||
_maxVisibleDistanceOnContinents = sConfigMgr->GetOption<float>("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE);
|
||||
if (_maxVisibleDistanceOnContinents < 45 * sWorld->getRate(RATE_CREATURE_AGGRO))
|
||||
if (_maxVisibleDistanceOnContinents < 45 * getRate(RATE_CREATURE_AGGRO))
|
||||
{
|
||||
LOG_ERROR("server.loading", "Visibility.Distance.Continents can't be less max aggro radius {}", 45 * sWorld->getRate(RATE_CREATURE_AGGRO));
|
||||
_maxVisibleDistanceOnContinents = 45 * sWorld->getRate(RATE_CREATURE_AGGRO);
|
||||
LOG_ERROR("server.loading", "Visibility.Distance.Continents can't be less max aggro radius {}", 45 * getRate(RATE_CREATURE_AGGRO));
|
||||
_maxVisibleDistanceOnContinents = 45 * getRate(RATE_CREATURE_AGGRO);
|
||||
}
|
||||
else if (_maxVisibleDistanceOnContinents > MAX_VISIBILITY_DISTANCE)
|
||||
{
|
||||
@@ -230,10 +230,10 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
//visibility in instances
|
||||
_maxVisibleDistanceInInstances = sConfigMgr->GetOption<float>("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE);
|
||||
if (_maxVisibleDistanceInInstances < 45 * sWorld->getRate(RATE_CREATURE_AGGRO))
|
||||
if (_maxVisibleDistanceInInstances < 45 * getRate(RATE_CREATURE_AGGRO))
|
||||
{
|
||||
LOG_ERROR("server.loading", "Visibility.Distance.Instances can't be less max aggro radius {}", 45 * sWorld->getRate(RATE_CREATURE_AGGRO));
|
||||
_maxVisibleDistanceInInstances = 45 * sWorld->getRate(RATE_CREATURE_AGGRO);
|
||||
LOG_ERROR("server.loading", "Visibility.Distance.Instances can't be less max aggro radius {}", 45 * getRate(RATE_CREATURE_AGGRO));
|
||||
_maxVisibleDistanceInInstances = 45 * getRate(RATE_CREATURE_AGGRO);
|
||||
}
|
||||
else if (_maxVisibleDistanceInInstances > MAX_VISIBILITY_DISTANCE)
|
||||
{
|
||||
@@ -243,10 +243,10 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
//visibility in BG/Arenas
|
||||
_maxVisibleDistanceInBGArenas = sConfigMgr->GetOption<float>("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS);
|
||||
if (_maxVisibleDistanceInBGArenas < 45 * sWorld->getRate(RATE_CREATURE_AGGRO))
|
||||
if (_maxVisibleDistanceInBGArenas < 45 * getRate(RATE_CREATURE_AGGRO))
|
||||
{
|
||||
LOG_ERROR("server.loading", "Visibility.Distance.BGArenas can't be less max aggro radius {}", 45 * sWorld->getRate(RATE_CREATURE_AGGRO));
|
||||
_maxVisibleDistanceInBGArenas = 45 * sWorld->getRate(RATE_CREATURE_AGGRO);
|
||||
LOG_ERROR("server.loading", "Visibility.Distance.BGArenas can't be less max aggro radius {}", 45 * getRate(RATE_CREATURE_AGGRO));
|
||||
_maxVisibleDistanceInBGArenas = 45 * getRate(RATE_CREATURE_AGGRO);
|
||||
}
|
||||
else if (_maxVisibleDistanceInBGArenas > MAX_VISIBILITY_DISTANCE)
|
||||
{
|
||||
@@ -1000,7 +1000,7 @@ void World::SetInitialWorldSettings()
|
||||
|
||||
sScriptMgr->OnBeforeWorldInitialized();
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_PRELOAD_ALL_NON_INSTANCED_MAP_GRIDS))
|
||||
if (getBoolConfig(CONFIG_PRELOAD_ALL_NON_INSTANCED_MAP_GRIDS))
|
||||
{
|
||||
LOG_INFO("server.loading", "Loading All Grids For All Non-Instanced Maps...");
|
||||
|
||||
@@ -1196,7 +1196,7 @@ void World::Update(uint32 diff)
|
||||
}
|
||||
|
||||
/// <li> Clean logs table
|
||||
if (sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer
|
||||
if (getIntConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer
|
||||
{
|
||||
if (_timers[WUPDATE_CLEANDB].Passed())
|
||||
{
|
||||
@@ -1205,7 +1205,7 @@ void World::Update(uint32 diff)
|
||||
_timers[WUPDATE_CLEANDB].Reset();
|
||||
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_LOGS);
|
||||
stmt->SetData(0, sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME));
|
||||
stmt->SetData(0, getIntConfig(CONFIG_LOGDB_CLEARTIME));
|
||||
stmt->SetData(1, uint32(currentGameTime.count()));
|
||||
LoginDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -1222,7 +1222,7 @@ void World::Update(uint32 diff)
|
||||
sMapMgr->Update(diff);
|
||||
}
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_AUTOBROADCAST))
|
||||
if (getBoolConfig(CONFIG_AUTOBROADCAST))
|
||||
{
|
||||
if (_timers[WUPDATE_AUTOBROADCAST].Passed())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user