mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user