aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-10-26 17:06:50 +0200
committerShauren <shauren.trinity@gmail.com>2013-10-26 17:06:50 +0200
commit75a790ca475c6af31730d331a3ab185f8abdd6e2 (patch)
treef961f8de614ac7e1dfc1f17c68e83c7d14feff20 /src/server/game/Spells/SpellEffects.cpp
parent8d6aec608f0cd323d291dc12efce32f630590a23 (diff)
parentb81bf7d0250939ee96b942f554c16d950f06c7b1 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index d951d5c62ef..7fcac6080fe 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -807,7 +807,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
// Remove spell cooldown (not category) if spell triggering spell with cooldown and same category
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->CategoryRecoveryTime && spellInfo->CategoryRecoveryTime
- && m_spellInfo->Category == spellInfo->Category)
+ && m_spellInfo->GetCategory() == spellInfo->GetCategory())
m_caster->ToPlayer()->RemoveSpellCooldown(spellInfo->Id);
// original caster guid only for GO cast
@@ -860,7 +860,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex)
// Remove spell cooldown (not category) if spell triggering spell with cooldown and same category
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->CategoryRecoveryTime && spellInfo->CategoryRecoveryTime
- && m_spellInfo->Category == spellInfo->Category)
+ && m_spellInfo->GetCategory() == spellInfo->GetCategory())
m_caster->ToPlayer()->RemoveSpellCooldown(spellInfo->Id);
// original caster guid only for GO cast
@@ -1014,10 +1014,15 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
orientation = m_targets.GetUnitTarget()->GetOrientation();
TC_LOG_DEBUG(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation);
- if (mapid == unitTarget->GetMapId())
- unitTarget->NearTeleportTo(x, y, z, orientation, unitTarget == m_caster);
- else if (unitTarget->GetTypeId() == TYPEID_PLAYER)
+ if (unitTarget->GetTypeId() == TYPEID_PLAYER)
unitTarget->ToPlayer()->TeleportTo(mapid, x, y, z, orientation, unitTarget == m_caster ? TELE_TO_SPELL : 0);
+ else if (mapid == unitTarget->GetMapId())
+ unitTarget->NearTeleportTo(x, y, z, orientation, unitTarget == m_caster);
+ else
+ {
+ TC_LOG_ERROR(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - spellId %u attempted to teleport creature to a different map.", m_spellInfo->Id);
+ return;
+ }
// post effects for TARGET_DEST_DB
switch (m_spellInfo->Id)
@@ -2353,7 +2358,7 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
// On success dispel
// Devour Magic
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC)
+ if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->GetCategory() == SPELLCATEGORY_DEVOUR_MAGIC)
{
int32 heal_amount = m_spellInfo->Effects[EFFECT_1].CalcValue(m_caster);
m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, NULL, NULL, true);
@@ -3800,7 +3805,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case SPELLFAMILY_PALADIN:
{
// Judgement (seal trigger)
- if (m_spellInfo->Category == SPELLCATEGORY_JUDGEMENT)
+ if (m_spellInfo->GetCategory() == SPELLCATEGORY_JUDGEMENT)
{
if (!unitTarget || !unitTarget->IsAlive())
return;