aboutsummaryrefslogtreecommitdiff
path: root/src/game/Item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Item.cpp')
-rw-r--r--src/game/Item.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index 0197de1d3ff..1633885d382 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -285,8 +285,15 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
if (GetUInt32Value(ITEM_FIELD_DURATION)<=diff)
{
+ // variables to hold item location and entry data after item gets destroyed
+ uint32 itemEntry = GetEntry();
+ uint8 bagSlot = GetBagSlot();
+ uint8 slot = GetSlot();
+ uint16 pos = GetPos();
+
Script->ItemExpire(owner, GetProto());
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
+ owner->HandleDestroyItemReplace(itemEntry, bagSlot, slot, pos);
return;
}