aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2011-08-27 12:59:05 +0200
committerQAston <qaston@gmail.com>2011-08-27 12:59:57 +0200
commit875416607198acf7d6fc4ca15b11975f1127f36f (patch)
tree88215fb8f773768788ad738094799762f1f13101 /src
parent1faea1f98eadb2b96d51b42adb036a28134276f4 (diff)
Core/Spells: Send expected type of spell implicit target to client.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp7
-rwxr-xr-xsrc/server/game/Spells/Spell.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 6c7a0411812..4eee788e84e 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -698,6 +698,13 @@ void Spell::SelectSpellTargets()
if (!m_spellInfo->Effects[i].Effect)
continue;
+ // set expected type of implicit targets to be sent to client
+ uint32 implicitTargetMask = GetTargetFlagMask(m_spellInfo->Effects[i].TargetA.GetObjectType()) | GetTargetFlagMask(m_spellInfo->Effects[i].TargetB.GetObjectType());
+ if (implicitTargetMask & TARGET_FLAG_UNIT)
+ m_targets.SetTargetFlag(TARGET_FLAG_UNIT);
+ if (implicitTargetMask & (TARGET_FLAG_GAMEOBJECT | TARGET_FLAG_GAMEOBJECT_ITEM))
+ m_targets.SetTargetFlag(TARGET_FLAG_GAMEOBJECT);
+
uint32 effectTargetType = m_spellInfo->Effects[i].GetRequiredTargetType();
// is it possible that areaaura is not applied to caster?
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 2b0dd569e48..74198aa0dfd 100755
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -104,6 +104,8 @@ class SpellCastTargets
uint32 GetTargetMask() const { return m_targetMask; }
void SetTargetMask(uint32 newMask) { m_targetMask = newMask; }
+ void SetTargetFlag(SpellCastTargetFlags flag) { m_targetMask |= flag; }
+
uint64 GetUnitTargetGUID() const;
Unit* GetUnitTarget() const;
void SetUnitTarget(Unit* target);