aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/compiler/msvc/settings.cmake4
-rw-r--r--src/server/game/Spells/Spell.cpp3
-rw-r--r--src/server/game/Spells/SpellInfo.cpp13
-rw-r--r--src/server/game/Spells/SpellInfo.h2
-rw-r--r--src/server/game/Spells/SpellMgr.cpp12
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp3
6 files changed, 18 insertions, 19 deletions
diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake
index 423998f664c..f303b6ed761 100644
--- a/cmake/compiler/msvc/settings.cmake
+++ b/cmake/compiler/msvc/settings.cmake
@@ -55,9 +55,7 @@ endif()
# Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012, hence we need to set an upper limit with /Zm to avoid discrepancies)
# (And yes, this is a verified , unresolved bug with MSVC... *sigh*)
string(REGEX REPLACE "/Zm[0-9]+ *" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-if(MSVC_VERSION LESS 1800) # MSVC2012 and below
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500" CACHE STRING "" FORCE)
-endif()
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500" CACHE STRING "" FORCE)
# Enable and treat as errors the following warnings to easily detect virtual function signature failures:
# 'function' : member function does not override any base class virtual member function
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 01de77ba366..3734585be03 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -825,7 +825,8 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
for (uint32 j = effIndex + 1; j < MAX_SPELL_EFFECTS; ++j)
{
SpellEffectInfo const* effects = GetSpellInfo()->Effects;
- if (effects[effIndex].TargetA.GetTarget() == effects[j].TargetA.GetTarget() &&
+ if (effects[j].IsEffect() &&
+ effects[effIndex].TargetA.GetTarget() == effects[j].TargetA.GetTarget() &&
effects[effIndex].TargetB.GetTarget() == effects[j].TargetB.GetTarget() &&
effects[effIndex].ImplicitTargetConditions == effects[j].ImplicitTargetConditions &&
effects[effIndex].CalcRadius(m_caster) == effects[j].CalcRadius(m_caster) &&
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index e58a401575a..13e0721e837 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -883,8 +883,10 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
PowerType = spellEntry->powerType;
RangeEntry = spellEntry->rangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->rangeIndex) : NULL;
Speed = spellEntry->speed;
+
for (uint8 i = 0; i < 2; ++i)
SpellVisual[i] = spellEntry->SpellVisual[i];
+
SpellIconID = spellEntry->SpellIconID;
ActiveIconID = spellEntry->activeIconID;
SpellName = spellEntry->SpellName;
@@ -1015,7 +1017,6 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
for (uint8 i = 0; i < 2; ++i)
Totem[i] = _totem ? _totem->Totem[i] : 0;
- ExplicitTargetMask = _GetExplicitTargetMask();
ChainEntry = NULL;
}
@@ -2484,15 +2485,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;
@@ -2502,6 +2502,7 @@ uint32 SpellInfo::_GetExplicitTargetMask() const
{
if (!Effects[i].IsEffect())
continue;
+
targetMask |= Effects[i].TargetA.GetExplicitTargetMask(srcSet, dstSet);
targetMask |= Effects[i].TargetB.GetExplicitTargetMask(srcSet, dstSet);
@@ -2515,9 +2516,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
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index 070faba1b4f..73d2ce3efcd 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -512,7 +512,7 @@ public:
bool IsHighRankOf(SpellInfo const* spellInfo) const;
// loading helpers
- uint32 _GetExplicitTargetMask() const;
+ void _InitializeExplicitTargetMask();
bool _IsPositiveEffect(uint8 effIndex, bool deep) const;
bool _IsPositiveSpell() const;
static bool _IsPositiveTarget(uint32 targetA, uint32 targetB);
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index ae4e4ba2f08..fc28b1127df 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -2761,13 +2761,11 @@ void SpellMgr::LoadSpellInfoStore()
std::map<uint32, SpellEffectArray> effectsBySpell;
for (uint32 i = 0; i < sSpellEffectStore.GetNumRows(); ++i)
- {
SpellEffectEntry const* effect = sSpellEffectStore.LookupEntry(i);
if (!effect)
continue;
effectsBySpell[effect->EffectSpellId].effects[effect->EffectIndex] = effect;
- }
for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i)
if (SpellEntry const* spellEntry = sSpellStore.LookupEntry(i))
@@ -2779,20 +2777,16 @@ void SpellMgr::LoadSpellInfoStore()
void SpellMgr::UnloadSpellInfoStore()
{
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
- {
- if (mSpellInfoMap[i])
- delete mSpellInfoMap[i];
- }
+ delete mSpellInfoMap[i];
+
mSpellInfoMap.clear();
}
void SpellMgr::UnloadSpellInfoImplicitTargetConditionLists()
{
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
- {
if (mSpellInfoMap[i])
mSpellInfoMap[i]->_UnloadImplicitTargetConditionLists();
- }
}
void SpellMgr::LoadSpellInfoCustomAttributes()
@@ -3085,6 +3079,8 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
default:
break;
}
+
+ spellInfo->_InitializeExplicitTargetMask();
}
CreatureAI::FillAISpellInfo();
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
index 0adc6190d4b..79421ffe37e 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
@@ -408,7 +408,8 @@ public:
me->InterruptNonMeleeSpells(false);
Talk(EMOTE_BREATH);
- DoCast(me, PointData->SpellId);
+ if (PointData) /// @todo: In what cases is this null? What should we do?
+ DoCast(me, PointData->SpellId);
events.ScheduleEvent(EVENT_DEEP_BREATH, 70000);
}
break;