diff options
| author | Machiavelli <machiavelli.trinity@gmail.com> | 2011-02-26 23:00:09 +0100 |
|---|---|---|
| committer | Machiavelli <machiavelli.trinity@gmail.com> | 2011-02-26 23:00:09 +0100 |
| commit | 3ac80ee3a48223f25a2a633130de177ffcd5df11 (patch) | |
| tree | 885d5e001fa05e16a2c0683c0e39cb102aa6e353 /src/server/game/Server | |
| parent | 8497fb27e9ff104e99818fbe2c85eccf25e7931d (diff) | |
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.
Diffstat (limited to 'src/server/game/Server')
| -rwxr-xr-x | src/server/game/Server/Protocol/Handlers/SpellHandler.cpp | 21 |
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) |
