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:
parent
6a1866f5e6
commit
ac8b20922b
4 changed files with 53 additions and 12 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue