diff options
| author | Shauren <shauren.trinity@gmail.com> | 2015-01-10 01:35:47 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2015-01-10 01:35:47 +0100 |
| commit | faa583c7843af37d757bd46ca0bd226175dabc38 (patch) | |
| tree | 5af657d84903b337bdb22c341bb01f4e6aab1392 /src/server/game/Conditions/ConditionMgr.cpp | |
| parent | f6b30fdf616bd289dd668f98a0aed8dbfb14eba8 (diff) | |
Core/Maps: Updated map difficulties
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
| -rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 20d49855b8f..2542706e507 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1234,30 +1234,34 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond) SpellEffectInfo const* effect = spellInfo->GetEffect(DIFFICULTY_NONE, i); if (!effect) continue; + // check if effect is already a part of some shared mask bool found = false; for (std::list<uint32>::iterator itr = sharedMasks.begin(); itr != sharedMasks.end(); ++itr) { - if ((1<<i) & *itr) + if ((1 << i) & *itr) { found = true; break; } } + if (found) continue; // build new shared mask with found effect - uint32 sharedMask = (1<<i); + uint32 sharedMask = 1 << i; ConditionList* cmp = effect->ImplicitTargetConditions; - for (uint8 effIndex = i+1; effIndex < MAX_SPELL_EFFECTS; ++effIndex) + for (uint8 effIndex = i + 1; effIndex < MAX_SPELL_EFFECTS; ++effIndex) { SpellEffectInfo const* inner = spellInfo->GetEffect(DIFFICULTY_NONE, effIndex); if (!inner) continue; + if (inner->ImplicitTargetConditions == cmp) - sharedMask |= 1<<effIndex; + sharedMask |= 1 << effIndex; } + sharedMasks.push_back(sharedMask); } @@ -1304,7 +1308,7 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond) if (!eff) continue; - if ((1<<i) & commonMask) + if ((1 << i) & commonMask) { const_cast<SpellEffectInfo*>(eff)->ImplicitTargetConditions = sharedList; assigned = true; |
