mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-09 05:41:09 +00:00
feat(Core): GUID recycler (#1820)
Automatically recycle GUIDs, thus avoiding crashes when reaching the limit of data type "int" in MySQL.
This commit is contained in:
@@ -137,7 +137,7 @@ public:
|
||||
Map* map = player->GetMap();
|
||||
|
||||
GameObject* object = sObjectMgr->IsGameObjectStaticTransport(objectInfo->entry) ? new StaticTransport() : new GameObject();
|
||||
uint32 guidLow = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT);
|
||||
uint32 guidLow = sObjectMgr->GenerateRecycledLowGuid(HIGHGUID_GAMEOBJECT);
|
||||
|
||||
if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMaskForSpawn(), x, y, z, o, G3D::Quat(), 0, GO_STATE_READY))
|
||||
{
|
||||
@@ -655,7 +655,7 @@ public:
|
||||
|
||||
if (!object)
|
||||
{
|
||||
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, abs(guidLow));
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user