Core/Spells: fixed totems not inheriting spell bonus effects from their creator

This commit is contained in:
Ovahlord committed 2022-09-20 19:44:44 +02:00
1 parent bec87f7531
commit bc1d71e589
1 file changed
+4 -4
+4 -4
View File
@@ -6224,8 +6224,8 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
// Totems get their bonus damage from their owner
if (IsCreature() && IsTotem())
if (Unit* owner = GetOwner())
return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype, effIndex, stack);
if (Unit* creator = ObjectAccessor::GetUnit(*this, GetCreatorGUID()))
return creator->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype, effIndex, stack);
int32 DoneTotal = 0;
float DoneTotalMod = SpellDamagePctDone(victim, spellProto, damagetype);
@@ -6988,8 +6988,8 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
{
// For totems get healing bonus from owner (statue isn't totem in fact)
if (GetTypeId() == TYPEID_UNIT && IsTotem())
if (Unit* owner = GetOwner())
return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, effIndex, stack);
if (Unit* creator = ObjectAccessor::GetUnit(*this, GetCreatorGUID()))
return creator->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, effIndex, stack);
// Some spells don't benefit from done mods
if (spellProto->HasAttribute(SPELL_ATTR3_IGNORE_CASTER_MODIFIERS))