mirror of
https://github.com/noisiver/mod-weekendbonus.git
synced 2026-01-13 00:58:36 +00:00
Check multipliers
Added checks to make sure at least one multiplier is set higher than 1
This commit is contained in:
@@ -30,6 +30,7 @@ public:
|
||||
private:
|
||||
void LoadDefaultValues();
|
||||
void SetRates(bool /*active*/);
|
||||
bool HasActiveMultipliers();
|
||||
|
||||
bool Triggered;
|
||||
time_t LocalTime;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user