*Fix a crash caused by itemexpire.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-20 10:12:44 -05:00
parent ef4a701ba6
commit 48eef97f80

View File

@@ -285,9 +285,8 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
if (GetUInt32Value(ITEM_FIELD_DURATION)<=diff)
{
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
if(const ItemPrototype *proto = GetProto())
Script->ItemExpire(owner, proto);
Script->ItemExpire(owner, proto);
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
return;
}