fix(Core/Spells): pets should not dispel beneficials bufs from neutral units not being at war with pet's owner (#7230)

- Closes #6691
This commit is contained in:
UltraNix
2021-08-06 18:39:35 +02:00
committed by GitHub
parent ea76a0c2bb
commit 14ad1def8b
4 changed files with 39 additions and 14 deletions

View File

@@ -5137,7 +5137,27 @@ void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelCharges
if (dispelMask & (1 << DISPEL_DISEASE) && HasAura(50536))
dispelMask &= ~(1 << DISPEL_DISEASE);
bool positive = IsFriendlyTo(caster);
ReputationRank rank = GetReactionTo(caster);
bool positive = rank >= REP_FRIENDLY;
// Neutral unit not at war with caster should be treated as a friendly unit
if (rank == REP_NEUTRAL)
{
if (Player* casterPlayer = caster->GetAffectingPlayer())
{
if (FactionTemplateEntry const* factionTemplateEntry = GetFactionTemplateEntry())
{
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction))
{
if (factionEntry->CanBeSetAtWar())
{
positive = !casterPlayer->GetReputationMgr().IsAtWar(factionEntry);
}
}
}
}
}
Unit::VisibleAuraMap const* visibleAuras = GetVisibleAuras();
for (Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
{