diff options
author | Wyrserth <wyrserth@protonmail.com> | 2019-07-05 14:11:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-05 14:11:15 +0200 |
commit | 12e545f7e2247f91db3fd1e8e2f961982422a147 (patch) | |
tree | 0d5fe35be9b5e888e0953cf8625fc89962137f74 /src/server/game/Conditions/ConditionMgr.cpp | |
parent | c44fb37f74347e3b6d399c941716971503af4cf8 (diff) |
Core/Conditions: allow spellclick conditions to properly work for aura apply/remove (#23527)
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 7078b127520..2aa97eb2d48 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1026,6 +1026,11 @@ bool ConditionMgr::IsObjectMeetingVendorItemConditions(uint32 creatureId, uint32 return true; } +bool ConditionMgr::IsSpellUsedInSpellClickConditions(uint32 spellId) const +{ + return SpellsUsedInSpellClickConditions.find(spellId) != SpellsUsedInSpellClickConditions.end(); +} + ConditionMgr* ConditionMgr::instance() { static ConditionMgr instance; @@ -1226,6 +1231,8 @@ void ConditionMgr::LoadConditions(bool isReload) case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT: { SpellClickEventConditionStore[cond->SourceGroup][cond->SourceEntry].push_back(cond); + if (cond->ConditionType == CONDITION_AURA) + SpellsUsedInSpellClickConditions.insert(cond->ConditionValue1); valid = true; ++count; continue; // do not add to m_AllocatedMemory to avoid double deleting @@ -1275,6 +1282,8 @@ void ConditionMgr::LoadConditions(bool isReload) //handle not grouped conditions //add new Condition to storage based on Type/Entry + if (cond->SourceType == CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT && cond->ConditionType == CONDITION_AURA) + SpellsUsedInSpellClickConditions.insert(cond->ConditionValue1); ConditionStore[cond->SourceType][cond->SourceEntry].push_back(cond); ++count; } @@ -2377,6 +2386,7 @@ void ConditionMgr::Clean() delete *i; SpellClickEventConditionStore.clear(); + SpellsUsedInSpellClickConditions.clear(); for (ConditionEntriesByCreatureIdMap::iterator itr = NpcVendorConditionContainerStore.begin(); itr != NpcVendorConditionContainerStore.end(); ++itr) for (ConditionsByEntryMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it) |