diff options
author | Jeremy <Golrag@users.noreply.github.com> | 2023-08-26 14:03:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-26 14:03:42 +0200 |
commit | 0ede6c155605da602b3bafaa3a1212d9f924759b (patch) | |
tree | c30077044c03821c4af7db095f49b1edf71d7a05 /src/server/game/Events/GameEventMgr.cpp | |
parent | 3e7b5f982c3b518a642447f112fc628edd963ce2 (diff) |
Core/Battlegrounds: Rework queues (#29200)
* No more copies of Battleground classes
* FreesSlotQueues now have as key the MapId instead of queue id
* Random queues can now popup already busy specific battelgrounds (queues are NOT merged)
* Removed Holiday handling, this should already be handled in BattlegroundMgr::IsBGWeekend
Diffstat (limited to 'src/server/game/Events/GameEventMgr.cpp')
-rw-r--r-- | src/server/game/Events/GameEventMgr.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 12e9c070bfd..59ce82d1b3c 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -871,40 +871,6 @@ void GameEventMgr::LoadFromDB() } } - TC_LOG_INFO("server.loading", "Loading Game Event Battleground Holiday Data..."); - { - uint32 oldMSTime = getMSTime(); - - // 0 1 - QueryResult result = WorldDatabase.Query("SELECT EventEntry, BattlegroundID FROM game_event_battleground_holiday"); - - if (!result) - TC_LOG_INFO("server.loading", ">> Loaded 0 battleground holidays in game events. DB table `game_event_battleground_holiday` is empty."); - else - { - uint32 count = 0; - do - { - Field* fields = result->Fetch(); - - uint16 event_id = fields[0].GetUInt8(); - - if (event_id >= mGameEvent.size()) - { - TC_LOG_ERROR("sql.sql", "`game_event_battleground_holiday`: game event id ({}) is out of range compared to max event id in `game_event`.", event_id); - continue; - } - - mGameEventBattlegroundHolidays[event_id] = fields[1].GetUInt32(); - - ++count; - } - while (result->NextRow()); - - TC_LOG_INFO("server.loading", ">> Loaded {} battleground holidays in game events in {} ms.", count, GetMSTimeDiffToNow(oldMSTime)); - } - } - TC_LOG_INFO("server.loading", "Loading Game Event Pool Data..."); { uint32 oldMSTime = getMSTime(); @@ -986,7 +952,6 @@ void GameEventMgr::Initialize() mGameEventCreatureQuests.resize(maxEventId); mGameEventGameObjectQuests.resize(maxEventId); mGameEventVendors.resize(maxEventId); - mGameEventBattlegroundHolidays.resize(maxEventId, 0); mGameEventPoolIds.resize(maxEventId * 2 - 1); mGameEventNPCFlags.resize(maxEventId); mGameEventModelEquip.resize(maxEventId); @@ -1115,8 +1080,6 @@ void GameEventMgr::UnApplyEvent(uint16 event_id) UpdateEventNPCFlags(event_id); // remove vendor items UpdateEventNPCVendor(event_id, false); - // update bg holiday - UpdateBattlegroundSettings(); } void GameEventMgr::ApplyNewEvent(uint16 event_id) @@ -1141,8 +1104,6 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id) UpdateEventNPCFlags(event_id); // add vendor items UpdateEventNPCVendor(event_id, true); - // update bg holiday - UpdateBattlegroundSettings(); //! Run SAI scripts with SMART_EVENT_GAME_EVENT_START RunSmartAIScripts(event_id, true); @@ -1185,14 +1146,6 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id) } } -void GameEventMgr::UpdateBattlegroundSettings() -{ - sBattlegroundMgr->ResetHolidays(); - - for (uint16 activeEventId : m_ActiveEvents) - sBattlegroundMgr->SetHolidayActive(mGameEventBattlegroundHolidays[activeEventId]); -} - void GameEventMgr::UpdateEventNPCVendor(uint16 event_id, bool activate) { for (NPCVendorMap::iterator itr = mGameEventVendors[event_id].begin(); itr != mGameEventVendors[event_id].end(); ++itr) |