mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
Prevent GUID from exhausting
This commit is contained in:
@@ -1086,7 +1086,7 @@ void Item::SendTimeUpdate(Player* owner)
|
||||
owner->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, bool clone, uint32 randomPropertyId)
|
||||
Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, bool clone, uint32 randomPropertyId, bool temp)
|
||||
{
|
||||
if (count < 1)
|
||||
return nullptr; //don't create item at zero count
|
||||
@@ -1100,7 +1100,8 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, bool clo
|
||||
ASSERT_NODEBUGINFO(count != 0 && "pProto->Stackable == 0 but checked at loading already");
|
||||
|
||||
Item* pItem = NewItemOrBag(pProto);
|
||||
if (pItem->Create(sObjectMgr->GetGenerator<HighGuid::Item>().Generate(), item, player))
|
||||
uint32 guid = temp ? 0xFFFFFFFF : sObjectMgr->GetGenerator<HighGuid::Item>().Generate();
|
||||
if (pItem->Create(guid, item, player))
|
||||
{
|
||||
pItem->SetCount(count);
|
||||
if (!clone)
|
||||
|
||||
@@ -213,7 +213,7 @@ bool ItemCanGoIntoBag(ItemTemplate const* proto, ItemTemplate const* pBagProto);
|
||||
class Item : public Object
|
||||
{
|
||||
public:
|
||||
static Item* CreateItem(uint32 item, uint32 count, Player const* player = nullptr, bool clone = false, uint32 randomPropertyId = 0);
|
||||
static Item* CreateItem(uint32 item, uint32 count, Player const* player = nullptr, bool clone = false, uint32 randomPropertyId = 0, bool temp = false);
|
||||
Item* CloneItem(uint32 count, Player const* player = nullptr) const;
|
||||
|
||||
Item();
|
||||
|
||||
Reference in New Issue
Block a user