aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authorraczman <none@none>2009-05-23 13:22:44 +0200
committerraczman <none@none>2009-05-23 13:22:44 +0200
commitf5f1caf6b67f53a4a2533fdd6ac260000fcb2bcc (patch)
tree87965f865ed7a7dee177b34f7f33e2b3c79e2d21 /src/game/Spell.cpp
parent08e1ec8a8a5d626cdfee6e8274e903f608bab769 (diff)
Rewrite of EffectMomentMove, this should finally fix blink.
* Even when player cannot move, only effect will fail, which means other spelleffects will work. * Vmaps are required for proper work (as expected) Please test and report bugs. --HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 6aca2ae028e..9d548da4ed4 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4116,20 +4116,7 @@ uint8 Spell::CanCast(bool strict)
case SPELL_EFFECT_LEAP:
case SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER:
{
- float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
- float fx = m_caster->GetPositionX() + dis * cos(m_caster->GetOrientation());
- float fy = m_caster->GetPositionY() + dis * sin(m_caster->GetOrientation());
- // teleport a bit above terrain level to avoid falling below it
- float fz = MapManager::Instance().GetBaseMap(m_caster->GetMapId())->GetHeight(fx,fy,m_caster->GetPositionZ(),true);
- if(fz <= INVALID_HEIGHT) // note: this also will prevent use effect in instances without vmaps height enabled
- return SPELL_FAILED_TRY_AGAIN;
-
- float caster_pos_z = m_caster->GetPositionZ();
- // Control the caster to not climb or drop when +-fz > 8
- if(!(fz<=caster_pos_z+8 && fz>=caster_pos_z-8))
- return SPELL_FAILED_TRY_AGAIN;
-
- // not allow use this effect at battleground until battleground start
+ //Do not allow to cast it before BG starts.
if(m_caster->GetTypeId()==TYPEID_PLAYER)
if(BattleGround const *bg = ((Player*)m_caster)->GetBattleGround())
if(bg->GetStatus() != STATUS_IN_PROGRESS)