From 3ac80ee3a48223f25a2a633130de177ffcd5df11 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 26 Feb 2011 23:00:09 +0100 Subject: Core/Vehicles: Correct usage of npc_spellclick_spells instead of blatant hacks for vehicle entry. Note: This may break a few vehicles, but only due to the absence of proper, non-hackish data. --- .../game/Server/Protocol/Handlers/SpellHandler.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'src/server/game/Server') 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) -- cgit v1.2.3