diff options
| author | Shauren <shauren.trinity@gmail.com> | 2013-07-29 19:00:34 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2013-07-29 19:00:34 +0200 |
| commit | d26afd77039649170223d746441bed08e3c82722 (patch) | |
| tree | a43ff0cb1bf592bf0cc61f264ce1dfef31dc110f /src/server/game/Spells/SpellInfo.cpp | |
| parent | a91e42f20d712a80b600271e82d958cf02afa35c (diff) | |
Core/Spells: Fixed crashes happening with spells that had their dbc targets overriden
Closes #10395
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index c813f9bbd27..a58c2ee19e4 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -816,23 +816,30 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) StackAmount = spellEntry->StackAmount; for (uint8 i = 0; i < 2; ++i) Totem[i] = spellEntry->Totem[i]; + for (uint8 i = 0; i < MAX_SPELL_REAGENTS; ++i) Reagent[i] = spellEntry->Reagent[i]; + for (uint8 i = 0; i < MAX_SPELL_REAGENTS; ++i) ReagentCount[i] = spellEntry->ReagentCount[i]; + EquippedItemClass = spellEntry->EquippedItemClass; EquippedItemSubClassMask = spellEntry->EquippedItemSubClassMask; EquippedItemInventoryTypeMask = spellEntry->EquippedItemInventoryTypeMask; for (uint8 i = 0; i < 2; ++i) TotemCategory[i] = spellEntry->TotemCategory[i]; + for (uint8 i = 0; i < 2; ++i) SpellVisual[i] = spellEntry->SpellVisual[i]; + SpellIconID = spellEntry->SpellIconID; ActiveIconID = spellEntry->activeIconID; for (uint8 i = 0; i < 16; ++i) SpellName[i] = spellEntry->SpellName[i]; + for (uint8 i = 0; i < 16; ++i) Rank[i] = spellEntry->Rank[i]; + MaxTargetLevel = spellEntry->MaxTargetLevel; MaxAffectedTargets = spellEntry->MaxAffectedTargets; SpellFamilyName = spellEntry->SpellFamilyName; @@ -843,7 +850,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) SchoolMask = spellEntry->SchoolMask; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) Effects[i] = SpellEffectInfo(spellEntry, this, i); - ExplicitTargetMask = _GetExplicitTargetMask(); + ChainEntry = NULL; } @@ -2270,15 +2277,14 @@ bool SpellInfo::IsDifferentRankOf(SpellInfo const* spellInfo) const bool SpellInfo::IsHighRankOf(SpellInfo const* spellInfo) const { if (ChainEntry && spellInfo->ChainEntry) - { if (ChainEntry->first == spellInfo->ChainEntry->first) if (ChainEntry->rank > spellInfo->ChainEntry->rank) return true; - } + return false; } -uint32 SpellInfo::_GetExplicitTargetMask() const +void SpellInfo::_InitializeExplicitTargetMask() { bool srcSet = false; bool dstSet = false; @@ -2288,6 +2294,7 @@ uint32 SpellInfo::_GetExplicitTargetMask() const { if (!Effects[i].IsEffect()) continue; + targetMask |= Effects[i].TargetA.GetExplicitTargetMask(srcSet, dstSet); targetMask |= Effects[i].TargetB.GetExplicitTargetMask(srcSet, dstSet); @@ -2301,9 +2308,11 @@ uint32 SpellInfo::_GetExplicitTargetMask() const // don't add explicit object/dest flags when spell has no max range if (GetMaxRange(true) == 0.0f && GetMaxRange(false) == 0.0f) effectTargetMask &= ~(TARGET_FLAG_UNIT_MASK | TARGET_FLAG_GAMEOBJECT | TARGET_FLAG_CORPSE_MASK | TARGET_FLAG_DEST_LOCATION); + targetMask |= effectTargetMask; } - return targetMask; + + ExplicitTargetMask = targetMask; } bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const |
