mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-09 19:49:32 +01:00
Scripts/Deadmines: Fix OnUse hook usage, thanks zaphod, closes issue 3942.
Note: If you spot similar errors (forgotten changes for hooks) in other scripts, please report them --HG-- branch : trunk
This commit is contained in:
@@ -36,13 +36,13 @@ class item_defias_gunpowder : public ItemScript
|
||||
public:
|
||||
item_defias_gunpowder() : ItemScript("item_defias_gunpowder") { }
|
||||
|
||||
bool ItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
|
||||
{
|
||||
InstanceScript *pInstance = pPlayer->GetInstanceScript();
|
||||
InstanceScript *pInstance = player->GetInstanceScript();
|
||||
|
||||
if (!pInstance)
|
||||
{
|
||||
pPlayer->GetSession()->SendNotification("Instance script not initialized");
|
||||
player->GetSession()->SendNotification("Instance script not initialized");
|
||||
return true;
|
||||
}
|
||||
if (pInstance->GetData(EVENT_STATE)!= CANNON_NOT_USED)
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
pInstance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED);
|
||||
}
|
||||
|
||||
pPlayer->DestroyItemCount(pItem->GetEntry(), 1, true);
|
||||
player->DestroyItemCount(item->GetEntry(), 1, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user