From c6b86026195e027af32c866c69a6382b3fb19d00 Mon Sep 17 00:00:00 2001 From: Trazom62 Date: Sat, 3 Apr 2010 08:22:04 +0200 Subject: [PATCH] Fix Hymn of Hope. Thanks Proof. Fixes issue #1322. Fixes issue #1428. --HG-- branch : trunk --- src/game/SpellAuraEffects.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/game/SpellAuraEffects.cpp b/src/game/SpellAuraEffects.cpp index d12817eaef..3adfe15d74 100644 --- a/src/game/SpellAuraEffects.cpp +++ b/src/game/SpellAuraEffects.cpp @@ -4679,8 +4679,13 @@ void AuraEffect::HandleAuraModIncreaseEnergy(AuraApplication const * aurApp, uin // Special case with temporary increase max/current power (percent) if (GetId()==64904) // Hymn of Hope { - if(mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK) - target->SetPower(powerType, apply ? GetAmount() + target->GetPower(powerType) : target->GetPower(powerType) - GetAmount()); + if (mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK) + { + int32 change = target->GetPower(powerType) + (apply ? GetAmount() : -GetAmount()); + if (change < 0) + change = 0; + target->SetPower(powerType, change); + } } // generic flat case