Added a simple check to prevent DoEnduranceUpkeep (1 sec persistent timer)

from constantly checking when client has no endurance drain effects.
This was running 24/7 for all classes.
This commit is contained in:
KayenEQ
2014-11-12 01:54:21 -05:00
parent 22cc86e6a0
commit 59bcd031c8
5 changed files with 25 additions and 4 deletions
+8 -1
View File
@@ -1160,10 +1160,14 @@ void Merc::SetEndurance(int32 newEnd)
}
void Merc::DoEnduranceUpkeep() {
int upkeep_sum = 0;
if (!HasEndurUpkeep())
return;
int upkeep_sum = 0;
int cost_redux = spellbonuses.EnduranceReduction + itembonuses.EnduranceReduction;
bool has_effect = false;
uint32 buffs_i;
uint32 buff_count = GetMaxTotalSlots();
for (buffs_i = 0; buffs_i < buff_count; buffs_i++) {
@@ -1187,6 +1191,9 @@ void Merc::DoEnduranceUpkeep() {
if(upkeep_sum != 0)
SetEndurance(GetEndurance() - upkeep_sum);
if (!has_effect)
SetEndurUpkeep(false);
}
void Merc::CalcRestState() {