Fix /camp rest timer exploit

This commit is contained in:
Michael Cook (mackal)
2018-07-14 17:41:42 -04:00
parent d0956194af
commit 37ff8c830d
6 changed files with 27 additions and 47 deletions
+5 -4
View File
@@ -1933,12 +1933,11 @@ void Client::DoEnduranceUpkeep() {
SetEndurUpkeep(false);
}
void Client::CalcRestState() {
void Client::CalcRestState()
{
// This method calculates rest state HP and mana regeneration.
// The client must have been out of combat for RuleI(Character, RestRegenTimeToActivate) seconds,
// must be sitting down, and must not have any detrimental spells affecting them.
//
if(!RuleB(Character, RestRegenEnabled))
return;
@@ -1950,6 +1949,9 @@ void Client::CalcRestState() {
if(!rest_timer.Check(false))
return;
// so we don't have aggro, our timer has expired, we do not want this to cause issues
m_pp.RestTimer = 0;
uint32 buff_count = GetMaxTotalSlots();
for (unsigned int j = 0; j < buff_count; j++) {
if(buffs[j].spellid != SPELL_UNKNOWN) {
@@ -1960,7 +1962,6 @@ void Client::CalcRestState() {
}
ooc_regen = true;
}
void Client::DoTracking()