mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 22:26:22 +00:00
fix(Core/DB/Events): Game Event on Calendar (#2890)
* Game events will now show on Calendar * Implement holiday_duration in holiday_dates (holiday_duration is the number of hours of how long the holiday may last (visible in the calendar)) * Fix all Start Dates of all events Co-authored-by: Ovah <ovahlord@users.noreply.github.com> Co-authored-by: natnat201193 <natnat201193@users.noreply.github.com> Co-authored-by: Eridium <killyana@users.noreply.github.com>
This commit is contained in:
@@ -982,8 +982,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)
|
||||
{
|
||||
@@ -995,6 +995,7 @@ void GameEventMgr::LoadHolidayDates()
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 holidayId = fields[0].GetUInt32();
|
||||
HolidaysEntry* entry = const_cast<HolidaysEntry*>(sHolidaysStore.LookupEntry(holidayId));
|
||||
if (!entry)
|
||||
@@ -1002,6 +1003,7 @@ void GameEventMgr::LoadHolidayDates()
|
||||
sLog->outErrorDb("holiday_dates entry has invalid holiday id %u.", holidayId);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint8 dateId = fields[1].GetUInt8();
|
||||
if (dateId >= MAX_HOLIDAY_DATES)
|
||||
{
|
||||
@@ -1009,6 +1011,10 @@ void GameEventMgr::LoadHolidayDates()
|
||||
continue;
|
||||
}
|
||||
entry->Date[dateId] = fields[2].GetUInt32();
|
||||
|
||||
if (uint32 duration = fields[3].GetUInt32())
|
||||
entry->Duration[0] = duration;
|
||||
|
||||
modifiedHolidays.insert(entry->Id);
|
||||
++count;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user