All pastes #967169 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-04-02 06:58 UTC
rendered paste body
Index: src/game/Spell.cpp
===================================================================
--- src/game/Spell.cpp	(revision 5491)
+++ src/game/Spell.cpp	(working copy)
@@ -1519,6 +1519,15 @@
         return;
     }
 
+	// We cant cast negative spell at Flight Target (even if m_caster == target)
+	Unit *target = targets->getUnitTarget();
+	if(target && target->isInFlight())
+	{
+	     SendCastResult(SPELL_FAILED_NOT_ON_TAXI);
+        finish(false);
+        return;
+	}
+
     uint8 result = CanCast(true);
     if(result != 0)
     {
@@ -2695,11 +2704,8 @@
     {
         if(target != m_caster)
         {
-            // Not allow casting on flying player
-            if (target->isInFlight())
-                return SPELL_FAILED_BAD_TARGETS;
 
-            if(VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target))
+			if(VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target))
                 return SPELL_FAILED_LINE_OF_SIGHT;
 
             // auto selection spell rank implemented in WorldSession::HandleCastSpellOpcode
@@ -2808,12 +2814,7 @@
 
     // not let players cast spells at mount (and let do it to creatures)
     if(m_caster->IsMounted() && m_caster->GetTypeId()==TYPEID_PLAYER && !m_IsTriggeredSpell && !IsPassiveSpell(m_spellInfo->Id) && !(m_spellInfo->Attributes & 0x1000000))
-    {
-        if(m_caster->isInFlight())
-            return SPELL_FAILED_NOT_FLYING;
-        else
-            return SPELL_FAILED_NOT_MOUNTED;
-    }
+    return SPELL_FAILED_NOT_MOUNTED;
 
     // always (except passive spells) check items (focus object can be required for any type casts)
     if(!IsPassiveSpell(m_spellInfo->Id))