aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo <sirikfoll@hotmail.com>2016-07-15 18:45:50 -0300
committerjoschiwald <joschiwald.trinity@gmail.com>2017-02-05 20:00:55 +0100
commit4a21e8158f124c3db62a68aabd4bea7711a4df4c (patch)
tree283dbf49500788d5579c844fbe56e2dbd9a897ff
parentc5c399e14fbb35398ab06563a6294d3d69fb7284 (diff)
Core/Spells GameObjects needs to be spawned in order to be acceptable as a SpellFocus (#17594)
(cherry picked from commit 23e89b8aef1999bbbd52248c40d7b76c0a67cafb) # Conflicts: # src/server/game/Grids/Notifiers/GridNotifiers.h
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h3
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp14
2 files changed, 4 insertions, 13 deletions
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index f97f5ac298a..3ff1ae222af 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -635,6 +635,9 @@ namespace Trinity
if (go->GetGOInfo()->spellFocus.spellFocusType != i_focusId)
return false;
+ if (!go->isSpawned())
+ return false;
+
float dist = go->GetGOInfo()->spellFocus.radius / 2.f;
return go->IsWithinDistInMap(i_unit, dist);
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index b96d27590db..eb4a5ecf24d 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -1080,9 +1080,7 @@ enum RedSnapperVeryTasty
ITEM_RED_SNAPPER = 23614,
SPELL_CAST_NET = 29866,
- SPELL_NEW_SUMMON_TEST = 49214,
-
- GO_SCHOOL_OF_RED_SNAPPER = 181616
+ SPELL_NEW_SUMMON_TEST = 49214
};
class spell_q9452_cast_net: public SpellScriptLoader
@@ -1099,15 +1097,6 @@ class spell_q9452_cast_net: public SpellScriptLoader
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
- SpellCastResult CheckCast()
- {
- GameObject* go = GetCaster()->FindNearestGameObject(GO_SCHOOL_OF_RED_SNAPPER, 3.0f);
- if (!go || go->GetRespawnTime())
- return SPELL_FAILED_REQUIRES_SPELL_FOCUS;
-
- return SPELL_CAST_OK;
- }
-
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
@@ -1127,7 +1116,6 @@ class spell_q9452_cast_net: public SpellScriptLoader
void Register() override
{
- OnCheckCast += SpellCheckCastFn(spell_q9452_cast_net_SpellScript::CheckCast);
OnEffectHit += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleActiveObject, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT);
}