aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Server/Protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Server/Protocol')
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/SpellHandler.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp
index 864c5aa5146..82ab80172b7 100755
--- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp
@@ -559,25 +559,8 @@ void WorldSession::HandleSpellClick(WorldPacket & recv_data)
if (!unit->IsInWorld())
return;
- SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(unit->GetEntry());
- for (SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
- {
- if (itr->second.IsFitToRequirements(_player, unit))
- {
- Unit *caster = (itr->second.castFlags & NPC_CLICK_CAST_CASTER_PLAYER) ? (Unit*)_player : (Unit*)unit;
- Unit *target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_PLAYER) ? (Unit*)_player : (Unit*)unit;
- uint64 origCasterGUID = (itr->second.castFlags & NPC_CLICK_CAST_ORIG_CASTER_OWNER) ? unit->GetOwnerGUID() : 0;
- caster->CastSpell(target, itr->second.spellId, true, NULL, NULL, origCasterGUID);
- }
- }
-
- if (unit->IsVehicle())
- {
- if (unit->CheckPlayerCondition(_player))
- _player->EnterVehicle(unit);
- }
-
- unit->AI()->DoAction(EVENT_SPELLCLICK);
+ if (!unit->HandleSpellClick(_player))
+ sLog->outErrorDb("Missing npc_spellclick_spells data for creature %u", unit->GetEntry());
}
void WorldSession::HandleMirrrorImageDataRequest(WorldPacket & recv_data)