diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Events/GameEventMgr.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 13a08927a3b..910f740341a 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -950,8 +950,8 @@ void GameEventMgr::LoadHolidayDates() { uint32 oldMSTime = getMSTime(); - // 0 1 2 - QueryResult result = WorldDatabase.Query("SELECT id, date_id, date_value FROM holiday_dates"); + // 0 1 2 3 + QueryResult result = WorldDatabase.Query("SELECT id, date_id, date_value, holiday_duration FROM holiday_dates"); if (!result) { TC_LOG_INFO("server.loading", ">> Loaded 0 holiday dates. DB table `holiday_dates` is empty."); @@ -962,6 +962,7 @@ void GameEventMgr::LoadHolidayDates() do { Field* fields = result->Fetch(); + uint32 holidayId = fields[0].GetUInt32(); HolidaysEntry* entry = const_cast<HolidaysEntry*>(sHolidaysStore.LookupEntry(holidayId)); if (!entry) @@ -969,14 +970,19 @@ void GameEventMgr::LoadHolidayDates() TC_LOG_ERROR("sql.sql", "holiday_dates entry has invalid holiday id %u.", holidayId); continue; } + uint8 dateId = fields[1].GetUInt8(); if (dateId >= MAX_HOLIDAY_DATES) { TC_LOG_ERROR("sql.sql", "holiday_dates entry has out of range date_id %u.", dateId); continue; } + entry->Date[dateId] = fields[2].GetUInt32(); + if (uint32 duration = fields[3].GetUInt32()) + entry->Duration[0] = duration; + auto itr = std::lower_bound(modifiedHolidays.begin(), modifiedHolidays.end(), entry->Id); if (itr == modifiedHolidays.end() || *itr != entry->Id) modifiedHolidays.insert(itr, entry->Id); |
