diff options
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 60 | ||||
-rw-r--r-- | src/server/game/World/World.cpp | 82 |
2 files changed, 71 insertions, 71 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 236f19c21f6..f5542024956 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -729,7 +729,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() uint32 entry = fields[0].GetUInt32(); - if (!sObjectMgr->GetCreatureTemplate(entry)) + if (!GetCreatureTemplate(entry)) { TC_LOG_ERROR("sql.sql", "Creature template (Entry: %u) does not exist but has a record in `creature_template_addon`", entry); continue; @@ -1548,7 +1548,7 @@ void ObjectMgr::LoadEquipmentTemplates() uint32 entry = fields[0].GetUInt32(); - if (!sObjectMgr->GetCreatureTemplate(entry)) + if (!GetCreatureTemplate(entry)) { TC_LOG_ERROR("sql.sql", "Creature template (CreatureID: %u) does not exist but has a record in `creature_equip_template`", entry); continue; @@ -3479,13 +3479,13 @@ void ObjectMgr::LoadVehicleTemplateAccessories() uint8 summonType = fields[4].GetUInt8(); uint32 summonTimer = fields[5].GetUInt32(); - if (!sObjectMgr->GetCreatureTemplate(entry)) + if (!GetCreatureTemplate(entry)) { TC_LOG_ERROR("sql.sql", "Table `vehicle_template_accessory`: creature template entry %u does not exist.", entry); continue; } - if (!sObjectMgr->GetCreatureTemplate(accessory)) + if (!GetCreatureTemplate(accessory)) { TC_LOG_ERROR("sql.sql", "Table `vehicle_template_accessory`: Accessory %u does not exist.", accessory); continue; @@ -3527,7 +3527,7 @@ void ObjectMgr::LoadVehicleTemplate() uint32 creatureId = fields[0].GetUInt32(); - if (!sObjectMgr->GetCreatureTemplate(creatureId)) + if (!GetCreatureTemplate(creatureId)) { TC_LOG_ERROR("sql.sql", "Table `vehicle_template`: Vehicle %u does not exist.", creatureId); continue; @@ -3569,7 +3569,7 @@ void ObjectMgr::LoadVehicleAccessories() uint8 uiSummonType = fields[4].GetUInt8(); uint32 uiSummonTimer= fields[5].GetUInt32(); - if (!sObjectMgr->GetCreatureTemplate(uiAccessory)) + if (!GetCreatureTemplate(uiAccessory)) { TC_LOG_ERROR("sql.sql", "Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory); continue; @@ -3660,7 +3660,7 @@ void ObjectMgr::LoadPetLevelInfo() Field* fields = result->Fetch(); uint32 creature_id = fields[0].GetUInt32(); - if (!sObjectMgr->GetCreatureTemplate(creature_id)) + if (!GetCreatureTemplate(creature_id)) { TC_LOG_ERROR("sql.sql", "Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id); continue; @@ -4875,7 +4875,7 @@ void ObjectMgr::LoadQuests() if (qinfo->_sourceItemId) { - if (!sObjectMgr->GetItemTemplate(qinfo->_sourceItemId)) + if (!GetItemTemplate(qinfo->_sourceItemId)) { TC_LOG_ERROR("sql.sql", "Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), qinfo->_sourceItemId, qinfo->_sourceItemId); @@ -4940,22 +4940,22 @@ void ObjectMgr::LoadQuests() switch (obj.Type) { case QUEST_OBJECTIVE_ITEM: - if (!sObjectMgr->GetItemTemplate(obj.ObjectID)) + if (!GetItemTemplate(obj.ObjectID)) TC_LOG_ERROR("sql.sql", "Quest %u objective %u has non existing item entry %u, quest can't be done.", qinfo->GetQuestId(), obj.ID, obj.ObjectID); break; case QUEST_OBJECTIVE_MONSTER: - if (!sObjectMgr->GetCreatureTemplate(obj.ObjectID)) + if (!GetCreatureTemplate(obj.ObjectID)) TC_LOG_ERROR("sql.sql", "Quest %u objective %u has non existing creature entry %u, quest can't be done.", qinfo->GetQuestId(), obj.ID, uint32(obj.ObjectID)); break; case QUEST_OBJECTIVE_GAMEOBJECT: - if (!sObjectMgr->GetGameObjectTemplate(obj.ObjectID)) + if (!GetGameObjectTemplate(obj.ObjectID)) TC_LOG_ERROR("sql.sql", "Quest %u objective %u has non existing gameobject entry %u, quest can't be done.", qinfo->GetQuestId(), obj.ID, uint32(obj.ObjectID)); break; case QUEST_OBJECTIVE_TALKTO: - if (!sObjectMgr->GetCreatureTemplate(obj.ObjectID)) + if (!GetCreatureTemplate(obj.ObjectID)) TC_LOG_ERROR("sql.sql", "Quest %u objective %u has non existing creature entry %u, quest can't be done.", qinfo->GetQuestId(), obj.ID, uint32(obj.ObjectID)); break; @@ -4982,7 +4982,7 @@ void ObjectMgr::LoadQuests() TC_LOG_ERROR("sql.sql", "Quest %u objective %u has non existing spell id %d", qinfo->GetQuestId(), obj.ID, obj.ObjectID); break; case QUEST_OBJECTIVE_WINPETBATTLEAGAINSTNPC: - if (obj.ObjectID && !sObjectMgr->GetCreatureTemplate(obj.ObjectID)) + if (obj.ObjectID && !GetCreatureTemplate(obj.ObjectID)) TC_LOG_ERROR("sql.sql", "Quest %u objective %u has non existing creature entry %u, quest can't be done.", qinfo->GetQuestId(), obj.ID, uint32(obj.ObjectID)); break; @@ -5021,7 +5021,7 @@ void ObjectMgr::LoadQuests() uint32 id = qinfo->ItemDrop[j]; if (id) { - if (!sObjectMgr->GetItemTemplate(id)) + if (!GetItemTemplate(id)) { TC_LOG_ERROR("sql.sql", "Quest %u has `ItemDrop%d` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, id); @@ -5046,7 +5046,7 @@ void ObjectMgr::LoadQuests() switch (qinfo->RewardChoiceItemType[j]) { case LootItemType::Item: - if (!sObjectMgr->GetItemTemplate(id)) + if (!GetItemTemplate(id)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", qinfo->GetQuestId(), j + 1, id, id); @@ -5087,7 +5087,7 @@ void ObjectMgr::LoadQuests() uint32 id = qinfo->RewardItemId[j]; if (id) { - if (!sObjectMgr->GetItemTemplate(id)) + if (!GetItemTemplate(id)) { TC_LOG_ERROR("sql.sql", "Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", qinfo->GetQuestId(), j+1, id, id); @@ -5318,7 +5318,7 @@ void ObjectMgr::LoadQuests() break; } - qinfo = const_cast<Quest*>(sObjectMgr->GetQuestTemplate(breadcrumbForQuestId)); + qinfo = const_cast<Quest*>(GetQuestTemplate(breadcrumbForQuestId)); //every quest has a list of every breadcrumb towards it qinfo->DependentBreadcrumbQuests.push_back(qid); @@ -5467,14 +5467,14 @@ void ObjectMgr::LoadQuestGreetingLocales() switch (type) { case 0: // Creature - if (!sObjectMgr->GetCreatureTemplate(id)) + if (!GetCreatureTemplate(id)) { TC_LOG_ERROR("sql.sql", "Table `quest_greeting_locale`: creature template entry %u does not exist.", id); continue; } break; case 1: // GameObject - if (!sObjectMgr->GetGameObjectTemplate(id)) + if (!GetGameObjectTemplate(id)) { TC_LOG_ERROR("sql.sql", "Table `quest_greeting_locale`: gameobject template entry %u does not exist.", id); continue; @@ -6223,7 +6223,7 @@ void ObjectMgr::LoadInstanceTemplate() InstanceTemplate instanceTemplate; instanceTemplate.Parent = uint32(fields[1].GetUInt16()); - instanceTemplate.ScriptId = sObjectMgr->GetScriptId(fields[2].GetString()); + instanceTemplate.ScriptId = GetScriptId(fields[2].GetString()); _instanceTemplateStore[mapID] = instanceTemplate; @@ -6670,14 +6670,14 @@ void ObjectMgr::LoadQuestGreetings() switch (type) { case 0: // Creature - if (!sObjectMgr->GetCreatureTemplate(id)) + if (!GetCreatureTemplate(id)) { TC_LOG_ERROR("sql.sql", "Table `quest_greeting`: creature template entry %u does not exist.", id); continue; } break; case 1: // GameObject - if (!sObjectMgr->GetGameObjectTemplate(id)) + if (!GetGameObjectTemplate(id)) { TC_LOG_ERROR("sql.sql", "Table `quest_greeting`: gameobject template entry %u does not exist.", id); continue; @@ -7390,7 +7390,7 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const return nullptr; if (mapEntry->IsDungeon()) - if (InstanceTemplate const* iTemplate = sObjectMgr->GetInstanceTemplate(Map)) + if (InstanceTemplate const* iTemplate = GetInstanceTemplate(Map)) parentId = iTemplate->Parent; uint32 entrance_map = parentId.value_or(mapEntry->CorpseMapID); @@ -7879,7 +7879,7 @@ void ObjectMgr::LoadGameObjectTemplateAddons() uint32 entry = fields[0].GetUInt32(); - GameObjectTemplate const* got = sObjectMgr->GetGameObjectTemplate(entry); + GameObjectTemplate const* got = GetGameObjectTemplate(entry); if (!got) { TC_LOG_ERROR("sql.sql", "GameObject template (Entry: %u) does not exist but has a record in `gameobject_template_addon`", entry); @@ -8445,7 +8445,7 @@ void ObjectMgr::LoadQuestPOI() int32 spawnTrackingID = fields[13].GetInt32(); bool alwaysAllowMergingBlobs = fields[14].GetBool(); - if (!sObjectMgr->GetQuestTemplate(questID)) + if (!GetQuestTemplate(questID)) TC_LOG_ERROR("sql.sql", "`quest_poi` quest id (%u) Idx1 (%u) does not exist in `quest_template`", questID, idx1); if (std::map<int32, std::vector<QuestPOIBlobPoint>>* blobs = Trinity::Containers::MapGetValuePtr(allPoints, questID)) @@ -9804,7 +9804,7 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, uint8 type, bool per bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, VendorItem const& vItem, 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) @@ -9829,7 +9829,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, VendorItem const& vItem, return false; } - if ((vItem.Type == ITEM_VENDOR_TYPE_ITEM && !sObjectMgr->GetItemTemplate(vItem.item)) || + if ((vItem.Type == ITEM_VENDOR_TYPE_ITEM && !GetItemTemplate(vItem.item)) || (vItem.Type == ITEM_VENDOR_TYPE_CURRENCY && !sCurrencyTypesStore.LookupEntry(vItem.item))) { if (player) @@ -10154,9 +10154,9 @@ void ObjectMgr::LoadFactionChangeQuests() uint32 alliance = fields[0].GetUInt32(); uint32 horde = fields[1].GetUInt32(); - if (!sObjectMgr->GetQuestTemplate(alliance)) + if (!GetQuestTemplate(alliance)) TC_LOG_ERROR("sql.sql", "Quest %u (alliance_id) referenced in `player_factionchange_quests` does not exist, pair skipped!", alliance); - else if (!sObjectMgr->GetQuestTemplate(horde)) + else if (!GetQuestTemplate(horde)) TC_LOG_ERROR("sql.sql", "Quest %u (horde_id) referenced in `player_factionchange_quests` does not exist, pair skipped!", horde); else FactionChangeQuests[alliance] = horde; @@ -10921,7 +10921,7 @@ void ObjectMgr::LoadSceneTemplates() sceneTemplate.PlaybackFlags = static_cast<SceneFlag>(fields[1].GetUInt32()); sceneTemplate.ScenePackageId = fields[2].GetUInt32(); sceneTemplate.Encrypted = fields[3].GetUInt8() != 0; - sceneTemplate.ScriptId = sObjectMgr->GetScriptId(fields[4].GetCString()); + sceneTemplate.ScriptId = GetScriptId(fields[4].GetCString()); } while (templates->NextRow()); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 097590d2300..0a9f1a144e3 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1384,10 +1384,10 @@ void World::LoadConfigSettings(bool reload) // visibility on continents m_MaxVisibleDistanceOnContinents = sConfigMgr->GetFloatDefault("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE); - if (m_MaxVisibleDistanceOnContinents < 45*sWorld->getRate(RATE_CREATURE_AGGRO)) + if (m_MaxVisibleDistanceOnContinents < 45*getRate(RATE_CREATURE_AGGRO)) { - TC_LOG_ERROR("server.loading", "Visibility.Distance.Continents can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO)); - m_MaxVisibleDistanceOnContinents = 45*sWorld->getRate(RATE_CREATURE_AGGRO); + TC_LOG_ERROR("server.loading", "Visibility.Distance.Continents can't be less max aggro radius %f", 45*getRate(RATE_CREATURE_AGGRO)); + m_MaxVisibleDistanceOnContinents = 45*getRate(RATE_CREATURE_AGGRO); } else if (m_MaxVisibleDistanceOnContinents > MAX_VISIBILITY_DISTANCE) { @@ -1397,10 +1397,10 @@ void World::LoadConfigSettings(bool reload) // visibility in instances m_MaxVisibleDistanceInInstances = sConfigMgr->GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE); - if (m_MaxVisibleDistanceInInstances < 45*sWorld->getRate(RATE_CREATURE_AGGRO)) + if (m_MaxVisibleDistanceInInstances < 45*getRate(RATE_CREATURE_AGGRO)) { - TC_LOG_ERROR("server.loading", "Visibility.Distance.Instances can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO)); - m_MaxVisibleDistanceInInstances = 45*sWorld->getRate(RATE_CREATURE_AGGRO); + TC_LOG_ERROR("server.loading", "Visibility.Distance.Instances can't be less max aggro radius %f", 45*getRate(RATE_CREATURE_AGGRO)); + m_MaxVisibleDistanceInInstances = 45*getRate(RATE_CREATURE_AGGRO); } else if (m_MaxVisibleDistanceInInstances > MAX_VISIBILITY_DISTANCE) { @@ -1410,10 +1410,10 @@ void World::LoadConfigSettings(bool reload) // visibility in BG m_MaxVisibleDistanceInBG = sConfigMgr->GetFloatDefault("Visibility.Distance.BG", DEFAULT_VISIBILITY_BGARENAS); - if (m_MaxVisibleDistanceInBG < 45*sWorld->getRate(RATE_CREATURE_AGGRO)) + if (m_MaxVisibleDistanceInBG < 45*getRate(RATE_CREATURE_AGGRO)) { - TC_LOG_ERROR("server.loading", "Visibility.Distance.BG can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO)); - m_MaxVisibleDistanceInBG = 45*sWorld->getRate(RATE_CREATURE_AGGRO); + TC_LOG_ERROR("server.loading", "Visibility.Distance.BG can't be less max aggro radius %f", 45*getRate(RATE_CREATURE_AGGRO)); + m_MaxVisibleDistanceInBG = 45*getRate(RATE_CREATURE_AGGRO); } else if (m_MaxVisibleDistanceInBG > MAX_VISIBILITY_DISTANCE) { @@ -1423,10 +1423,10 @@ void World::LoadConfigSettings(bool reload) // Visibility in Arenas m_MaxVisibleDistanceInArenas = sConfigMgr->GetFloatDefault("Visibility.Distance.Arenas", DEFAULT_VISIBILITY_BGARENAS); - if (m_MaxVisibleDistanceInArenas < 45*sWorld->getRate(RATE_CREATURE_AGGRO)) + if (m_MaxVisibleDistanceInArenas < 45*getRate(RATE_CREATURE_AGGRO)) { - TC_LOG_ERROR("server.loading", "Visibility.Distance.Arenas can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO)); - m_MaxVisibleDistanceInArenas = 45*sWorld->getRate(RATE_CREATURE_AGGRO); + TC_LOG_ERROR("server.loading", "Visibility.Distance.Arenas can't be less max aggro radius %f", 45*getRate(RATE_CREATURE_AGGRO)); + m_MaxVisibleDistanceInArenas = 45*getRate(RATE_CREATURE_AGGRO); } else if (m_MaxVisibleDistanceInArenas > MAX_VISIBILITY_DISTANCE) { @@ -2577,7 +2577,7 @@ void World::Update(uint32 diff) { m_timers[WUPDATE_CHANNEL_SAVE].Reset(); - if (sWorld->getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS)) + if (getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS)) { TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Save custom channels")); ChannelMgr* mgr1 = ASSERT_NOTNULL(ChannelMgr::ForTeam(ALLIANCE)); @@ -2708,7 +2708,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 (m_timers[WUPDATE_CLEANDB].Passed()) { @@ -2717,7 +2717,7 @@ void World::Update(uint32 diff) LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_LOGS); - stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME)); + stmt->setUInt32(0, getIntConfig(CONFIG_LOGDB_CLEARTIME)); stmt->setUInt32(1, uint32(GameTime::GetGameTime())); stmt->setUInt32(2, realm.Id.Realm); @@ -2737,7 +2737,7 @@ void World::Update(uint32 diff) sTerrainMgr.Update(diff); } - if (sWorld->getBoolConfig(CONFIG_AUTOBROADCAST)) + if (getBoolConfig(CONFIG_AUTOBROADCAST)) { if (m_timers[WUPDATE_AUTOBROADCAST].Passed()) { @@ -3441,16 +3441,16 @@ void World::SendAutoBroadcast() return pair.second.Weight; }); - uint32 abcenter = sWorld->getIntConfig(CONFIG_AUTOBROADCAST_CENTER); + uint32 abcenter = getIntConfig(CONFIG_AUTOBROADCAST_CENTER); if (abcenter == 0) - sWorld->SendWorldText(LANG_AUTO_BROADCAST, itr->second.Message.c_str()); + SendWorldText(LANG_AUTO_BROADCAST, itr->second.Message.c_str()); else if (abcenter == 1) - sWorld->SendGlobalMessage(WorldPackets::Chat::PrintNotification(itr->second.Message).Write()); + SendGlobalMessage(WorldPackets::Chat::PrintNotification(itr->second.Message).Write()); else if (abcenter == 2) { - sWorld->SendWorldText(LANG_AUTO_BROADCAST, itr->second.Message.c_str()); - sWorld->SendGlobalMessage(WorldPackets::Chat::PrintNotification(itr->second.Message).Write()); + SendWorldText(LANG_AUTO_BROADCAST, itr->second.Message.c_str()); + SendGlobalMessage(WorldPackets::Chat::PrintNotification(itr->second.Message).Write()); } TC_LOG_DEBUG("misc", "AutoBroadcast: '%s'", itr->second.Message.c_str()); @@ -3485,9 +3485,9 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount) void World::InitQuestResetTimes() { - m_NextDailyQuestReset = sWorld->GetPersistentWorldVariable(NextDailyQuestResetTimeVarId); - m_NextWeeklyQuestReset = sWorld->GetPersistentWorldVariable(NextWeeklyQuestResetTimeVarId); - m_NextMonthlyQuestReset = sWorld->GetPersistentWorldVariable(NextMonthlyQuestResetTimeVarId); + m_NextDailyQuestReset = GetPersistentWorldVariable(NextDailyQuestResetTimeVarId); + m_NextWeeklyQuestReset = GetPersistentWorldVariable(NextWeeklyQuestResetTimeVarId); + m_NextMonthlyQuestReset = GetPersistentWorldVariable(NextMonthlyQuestResetTimeVarId); } static time_t GetNextDailyResetTime(time_t t) @@ -3519,7 +3519,7 @@ void World::DailyReset() ASSERT(now < next); m_NextDailyQuestReset = next; - sWorld->SetPersistentWorldVariable(NextDailyQuestResetTimeVarId, uint64(next)); + SetPersistentWorldVariable(NextDailyQuestResetTimeVarId, uint64(next)); TC_LOG_INFO("misc", "Daily quests for all characters have been reset."); } @@ -3558,7 +3558,7 @@ void World::ResetWeeklyQuests() ASSERT(now < next); m_NextWeeklyQuestReset = next; - sWorld->SetPersistentWorldVariable(NextWeeklyQuestResetTimeVarId, uint64(next)); + SetPersistentWorldVariable(NextWeeklyQuestResetTimeVarId, uint64(next)); TC_LOG_INFO("misc", "Weekly quests for all characters have been reset."); } @@ -3594,7 +3594,7 @@ void World::ResetMonthlyQuests() ASSERT(now < next); m_NextMonthlyQuestReset = next; - sWorld->SetPersistentWorldVariable(NextMonthlyQuestResetTimeVarId, uint64(next)); + SetPersistentWorldVariable(NextMonthlyQuestResetTimeVarId, uint64(next)); TC_LOG_INFO("misc", "Monthly quests for all characters have been reset."); } @@ -3612,7 +3612,7 @@ void World::CheckScheduledResetTimes() void World::InitRandomBGResetTime() { - time_t bgtime = sWorld->GetPersistentWorldVariable(NextBGRandomDailyResetTimeVarId); + time_t bgtime = GetPersistentWorldVariable(NextBGRandomDailyResetTimeVarId); if (!bgtime) m_NextRandomBGReset = GameTime::GetGameTime(); // game time not yet init @@ -3635,7 +3635,7 @@ void World::InitRandomBGResetTime() m_NextRandomBGReset = bgtime < curTime ? nextDayResetTime - DAY : nextDayResetTime; if (!bgtime) - sWorld->SetPersistentWorldVariable(NextBGRandomDailyResetTimeVarId, uint32(m_NextRandomBGReset)); + SetPersistentWorldVariable(NextBGRandomDailyResetTimeVarId, uint32(m_NextRandomBGReset)); } void World::InitCalendarOldEventsDeletionTime() @@ -3652,7 +3652,7 @@ void World::InitCalendarOldEventsDeletionTime() m_NextCalendarOldEventsDeletionTime = nextDeletionTime; if (!currentDeletionTime) - sWorld->SetPersistentWorldVariable(NextOldCalendarEventDeletionTimeVarId, uint64(m_NextCalendarOldEventsDeletionTime)); + SetPersistentWorldVariable(NextOldCalendarEventDeletionTimeVarId, uint64(m_NextCalendarOldEventsDeletionTime)); } void World::InitGuildResetTime() @@ -3680,12 +3680,12 @@ void World::InitGuildResetTime() m_NextGuildReset = gtime < curTime ? nextDayResetTime - DAY : nextDayResetTime; if (!gtime) - sWorld->SetPersistentWorldVariable(NextGuildDailyResetTimeVarId, uint32(m_NextGuildReset)); + SetPersistentWorldVariable(NextGuildDailyResetTimeVarId, uint32(m_NextGuildReset)); } void World::InitCurrencyResetTime() { - time_t currencytime = sWorld->GetPersistentWorldVariable(NextCurrencyResetTimeVarId); + time_t currencytime = GetPersistentWorldVariable(NextCurrencyResetTimeVarId); if (!currencytime) m_NextCurrencyReset = GameTime::GetGameTime(); // game time not yet init @@ -3710,7 +3710,7 @@ void World::InitCurrencyResetTime() m_NextCurrencyReset = currencytime < curTime ? nextWeekResetTime - getIntConfig(CONFIG_CURRENCY_RESET_INTERVAL) * DAY : nextWeekResetTime; if (!currencytime) - sWorld->SetPersistentWorldVariable(NextCurrencyResetTimeVarId, uint32(m_NextCurrencyReset)); + SetPersistentWorldVariable(NextCurrencyResetTimeVarId, uint32(m_NextCurrencyReset)); } void World::ResetCurrencyWeekCap() @@ -3722,7 +3722,7 @@ void World::ResetCurrencyWeekCap() itr->second->GetPlayer()->ResetCurrencyWeekCap(); m_NextCurrencyReset = time_t(m_NextCurrencyReset + DAY * getIntConfig(CONFIG_CURRENCY_RESET_INTERVAL)); - sWorld->SetPersistentWorldVariable(NextCurrencyResetTimeVarId, uint32(m_NextCurrencyReset)); + SetPersistentWorldVariable(NextCurrencyResetTimeVarId, uint32(m_NextCurrencyReset)); } void World::ResetEventSeasonalQuests(uint16 event_id, time_t eventStartTime) @@ -3751,7 +3751,7 @@ void World::ResetRandomBG() itr->second->GetPlayer()->SetRandomWinner(false); m_NextRandomBGReset = time_t(m_NextRandomBGReset + DAY); - sWorld->SetPersistentWorldVariable(NextBGRandomDailyResetTimeVarId, uint32(m_NextRandomBGReset)); + SetPersistentWorldVariable(NextBGRandomDailyResetTimeVarId, uint32(m_NextRandomBGReset)); } void World::CalendarDeleteOldEvents() @@ -3759,19 +3759,19 @@ void World::CalendarDeleteOldEvents() TC_LOG_INFO("misc", "Calendar deletion of old events."); m_NextCalendarOldEventsDeletionTime = time_t(m_NextCalendarOldEventsDeletionTime + DAY); - sWorld->SetPersistentWorldVariable(NextOldCalendarEventDeletionTimeVarId, uint64(m_NextCalendarOldEventsDeletionTime)); + SetPersistentWorldVariable(NextOldCalendarEventDeletionTimeVarId, uint64(m_NextCalendarOldEventsDeletionTime)); sCalendarMgr->DeleteOldEvents(); } void World::ResetGuildCap() { m_NextGuildReset = time_t(m_NextGuildReset + DAY); - sWorld->SetPersistentWorldVariable(NextGuildDailyResetTimeVarId, uint32(m_NextGuildReset)); + SetPersistentWorldVariable(NextGuildDailyResetTimeVarId, uint32(m_NextGuildReset)); uint32 week = GetPersistentWorldVariable(NextGuildWeeklyResetTimeVarId); week = week < 7 ? week + 1 : 1; TC_LOG_INFO("misc", "Guild Daily Cap reset. Week: %u", week == 1); - sWorld->SetPersistentWorldVariable(NextGuildWeeklyResetTimeVarId, week); + SetPersistentWorldVariable(NextGuildWeeklyResetTimeVarId, week); sGuildMgr->ResetTimes(week == 1); } @@ -3922,11 +3922,11 @@ void World::UpdateWarModeRewardValues() double total = warModeEnabledFaction[TEAM_ALLIANCE] + warModeEnabledFaction[TEAM_HORDE]; double pct = dominantFactionCount / total; - if (pct >= sWorld->getFloatConfig(CONFIG_CALL_TO_ARMS_20_PCT)) + if (pct >= getFloatConfig(CONFIG_CALL_TO_ARMS_20_PCT)) outnumberedFactionReward = 20; - else if (pct >= sWorld->getFloatConfig(CONFIG_CALL_TO_ARMS_10_PCT)) + else if (pct >= getFloatConfig(CONFIG_CALL_TO_ARMS_10_PCT)) outnumberedFactionReward = 10; - else if (pct >= sWorld->getFloatConfig(CONFIG_CALL_TO_ARMS_5_PCT)) + else if (pct >= getFloatConfig(CONFIG_CALL_TO_ARMS_5_PCT)) outnumberedFactionReward = 5; } |