From 58b6681047cb9f035bdf445790ab868b6a0a6f3c Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sat, 4 Feb 2023 19:54:17 +0100 Subject: [PATCH] Core/Spells: fixed Mana Tide amount calculation --- src/server/scripts/Spells/spell_shaman.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index db8cab004f..e762f594fb 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -841,9 +841,14 @@ class spell_sha_mana_tide_totem : public AuraScript void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { // @TODO: Exclude the "short term" buffs from the stat value - if (Unit* caster = GetUnitOwner()) - if (Unit* owner = caster->GetCharmerOrOwner()) - amount = CalculatePct(owner->GetStat(STAT_SPIRIT), amount); + Unit* caster = GetUnitOwner(); + if (!caster || !caster->IsSummon()) + return; + + if (Unit* summoner = caster->ToTempSummon()->GetSummoner()) + amount = CalculatePct(summoner->GetStat(STAT_SPIRIT), amount); + else + amount = 0; } void Register() override