From e0c699b0f303a22bdbea29e7e59b25a98d715a38 Mon Sep 17 00:00:00 2001 From: QAston Date: Thu, 9 Feb 2012 18:12:47 +0100 Subject: Core/Db/Conditions: allow CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET to be used for spells with any spell using unit as explicit target instead of just TARGET_UNIT_TARGET_ANY and TARGET_UNIT_TARGET_ENEMY. --- src/server/game/Conditions/ConditionMgr.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 330a38ba5dd..5ae8e3005c4 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -985,20 +985,11 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) if (!conditions.empty()) break; - for (int j = 0; j < MAX_SPELL_EFFECTS; ++j) + if (pSpellInfo->NeedsExplicitUnitTarget()) { - if (pSpellInfo->Effects[j].TargetA.GetTarget() == TARGET_UNIT_TARGET_ENEMY || - pSpellInfo->Effects[j].TargetB.GetTarget() == TARGET_UNIT_TARGET_ENEMY || - pSpellInfo->Effects[j].TargetA.GetTarget() == TARGET_UNIT_TARGET_ANY || - pSpellInfo->Effects[j].TargetB.GetTarget() == TARGET_UNIT_TARGET_ANY) - { - bIsItemSpellValid = true; - break; - } - } - - if (bIsItemSpellValid) + bIsItemSpellValid = true; break; + } } } } -- cgit v1.2.3