Skip to content

Commit

Permalink
Core/Events: Adjust timings and occurrence for Fireworks Show at New …
Browse files Browse the repository at this point in the history
…Years Eve

(cherry picked from commit ef4b8da)
  • Loading branch information
Kittnz authored and DoctorKraft committed Mar 17, 2018
1 parent 9759231 commit 53339c4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/server/scripts/Events/fireworks_show.cpp
Expand Up @@ -801,23 +801,22 @@ class go_cheer_speaker : public GameObjectScript
localtime_r(&time, &localTm);

// Start
if (((localTm.tm_min == 0 && localTm.tm_sec == 0) && !_started && IsHolidayActive(HOLIDAY_FIREWORKS_SPECTACULAR)) ||
((localTm.tm_hour == 0 && localTm.tm_min == 0 && localTm.tm_sec == 0) && !_started && IsEventActive(GAME_EVENT_NEW_YEAR)))
if ((localTm.tm_min == 0 && localTm.tm_sec == 0 && !_started) && (IsHolidayActive(HOLIDAY_FIREWORKS_SPECTACULAR) || IsEventActive(GAME_EVENT_NEW_YEAR)))
{
_events.ScheduleEvent(EVENT_CHEER, Seconds(1));
_events.ScheduleEvent(EVENT_FIRE, Seconds(1));
_started = true;
}

// Event is active
if ((localTm.tm_min >= 0 && localTm.tm_sec >= 1 && localTm.tm_min <= 9 && localTm.tm_sec <= 59) && !_started && IsHolidayActive(HOLIDAY_FIREWORKS_SPECTACULAR))
if ((localTm.tm_min >= 0 && localTm.tm_sec >= 1 && localTm.tm_min <= 9 && localTm.tm_sec <= 59 && !_started) && (IsHolidayActive(HOLIDAY_FIREWORKS_SPECTACULAR) || IsEventActive(GAME_EVENT_NEW_YEAR)))
{
_events.ScheduleEvent(EVENT_FIRE, Seconds(1));
_started = true;
}

// Stop
if ((localTm.tm_min == 10 && localTm.tm_sec == 0) || (localTm.tm_min == 10 && localTm.tm_sec == 0 && localTm.tm_hour == 0 && _started == true))
if ((localTm.tm_min == 10 && localTm.tm_sec == 0) && _started == true)
{
_started = false;
_events.ScheduleEvent(EVENT_CHEER, Seconds(1));
Expand Down

0 comments on commit 53339c4

Please sign in to comment.