mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-15 08:16:08 +00:00
fix(Core/Units): charmed creatures do not need to check hostility to attacked creature (#7043)
Properly remove channelled charm auras on demand. - Closes #5447
This commit is contained in:
@@ -462,9 +462,11 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
// not allow remove non positive spells and spells with attr SPELL_ATTR0_NO_AURA_CANCEL
|
||||
if ((!spellInfo->IsPositive() || spellInfo->HasAttribute(SPELL_ATTR0_NO_AURA_CANCEL) || spellInfo->IsPassive()) && spellId != 605)
|
||||
// not allow remove spells with attr SPELL_ATTR0_CANT_CANCEL
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_AURA_CANCEL))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// channeled spell case (it currently casted then)
|
||||
if (spellInfo->IsChanneled())
|
||||
@@ -475,6 +477,14 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
// non channeled case:
|
||||
// don't allow remove non positive spells
|
||||
// don't allow cancelling passive auras (some of them are visible)
|
||||
if (!spellInfo->IsPositive() || spellInfo->IsPassive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// maybe should only remove one buff when there are multiple?
|
||||
_player->RemoveOwnedAura(spellId, ObjectGuid::Empty, 0, AURA_REMOVE_BY_CANCEL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user