mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Eluna Closes:
#70, #69, #83, http://emudevs.com/showthread.php/3438-Custom-Items-and-On-Item-Use-Events Fixes Object::~Object crash log from #71
This commit is contained in:
10
HookMgr.cpp
10
HookMgr.cpp
@@ -401,14 +401,16 @@ bool Eluna::OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
|
||||
ObjectGuid guid = pItem->GET_GUID();
|
||||
bool castSpell = true;
|
||||
|
||||
if (!OnItemGossip(pPlayer, pItem, targets))
|
||||
if (!OnItemUse(pPlayer, pItem, targets))
|
||||
castSpell = false;
|
||||
|
||||
pItem = pPlayer->GetItemByGuid(guid);
|
||||
if (pItem && OnItemUse(pPlayer, pItem, targets))
|
||||
if (pItem)
|
||||
{
|
||||
if (!OnItemGossip(pPlayer, pItem, targets))
|
||||
castSpell = false;
|
||||
pItem = pPlayer->GetItemByGuid(guid);
|
||||
else
|
||||
castSpell = false;
|
||||
}
|
||||
|
||||
if (pItem && castSpell)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user