diff options
author | Shauren <shauren.trinity@gmail.com> | 2011-05-20 17:11:53 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2011-05-20 17:11:53 +0200 |
commit | 530323874484dca102155952d00a2ab0a0485763 (patch) | |
tree | 3a87a866aaf3e03ddd82e4f91fc54774ff5b66e6 /src | |
parent | db5ff45e817e3251c5878bb75195f6f1d1efd17f (diff) |
Core/Auras: Fixed infinite mana stacking exploit
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3aeda7d93bf..46d9975d318 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2935,7 +2935,7 @@ void AuraEffect::HandleSpiritOfRedemption(AuraApplication const * aurApp, uint8 target->SetHealth(1); } // die at aura end - else + else if (target->isAlive()) target->setDeathState(JUST_DIED); } @@ -5112,9 +5112,13 @@ void AuraEffect::HandleAuraModIncreaseEnergy(AuraApplication const * aurApp, uin Unit * target = aurApp->GetTarget(); - Powers powerType = target->getPowerType(); - if (int32(powerType) != GetMiscValue()) - return; + Powers powerType = Powers(GetMiscValue()); + // do not check power type, we can always modify the maximum + // as the client will not see any difference + // also, placing conditions that may change during the aura duration + // inside effect handlers is not a good idea + //if (int32(powerType) != GetMiscValue()) + // return; UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType); @@ -5141,9 +5145,13 @@ void AuraEffect::HandleAuraModIncreaseEnergyPercent(AuraApplication const * aurA Unit * target = aurApp->GetTarget(); - Powers powerType = target->getPowerType(); - if (int32(powerType) != GetMiscValue()) - return; + Powers powerType = Powers(GetMiscValue()); + // do not check power type, we can always modify the maximum + // as the client will not see any difference + // also, placing conditions that may change during the aura duration + // inside effect handlers is not a good idea + //if (int32(powerType) != GetMiscValue()) + // return; UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType); |