diff --git a/src/mod_weekendbonus.h b/src/mod_weekendbonus.h index 0cddeda..efe18d5 100644 --- a/src/mod_weekendbonus.h +++ b/src/mod_weekendbonus.h @@ -30,6 +30,7 @@ public: private: void LoadDefaultValues(); void SetRates(bool /*active*/); + bool HasActiveMultipliers(); bool Triggered; time_t LocalTime; diff --git a/src/mod_weekendbonus_world.cpp b/src/mod_weekendbonus_world.cpp index 3bb7fe0..645b970 100644 --- a/src/mod_weekendbonus_world.cpp +++ b/src/mod_weekendbonus_world.cpp @@ -2,6 +2,11 @@ void WeekendBonus::OnStartup() { + if (!HasActiveMultipliers) + { + return; + } + Triggered = false; LocalTime = time(NULL); @@ -11,6 +16,11 @@ void WeekendBonus::OnStartup() void WeekendBonus::OnUpdate(uint32 diff) { + if (!HasActiveMultipliers) + { + return; + } + CheckTime += Milliseconds(diff); if (CheckTime > CheckFrequency) { @@ -40,3 +50,13 @@ void WeekendBonus::OnUpdate(uint32 diff) } } } + +bool WeekendBonus::HasActiveMultipliers() +{ + if (ExperienceMultiplier > 1 || MoneyMultiplier > 1 || ProfessionsMultiplier > 1 || ReputationMultiplier > 1 || ProficienciesMultiplier > 1 || HonorMultiplier > 1) + { + return true; + } + + return false; +}