mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 09:39:11 +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:
@@ -212,7 +212,7 @@ public:
|
||||
if (Transport* tt = chr->GetTransport())
|
||||
if (MotionTransport* trans = tt->ToMotionTransport())
|
||||
{
|
||||
uint32 guid = sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT);
|
||||
uint32 guid = sObjectMgr->GenerateRecycledLowGuid(HIGHGUID_UNIT);
|
||||
CreatureData& data = sObjectMgr->NewOrExistCreatureData(guid);
|
||||
data.id = id;
|
||||
data.phaseMask = chr->GetPhaseMaskForSpawn();
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
}
|
||||
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, x, y, z, o))
|
||||
if (!creature->Create(sObjectMgr->GenerateRecycledLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, x, y, z, o))
|
||||
{
|
||||
delete creature;
|
||||
return false;
|
||||
@@ -741,7 +741,7 @@ public:
|
||||
for (uint8 i = 0; i < NPCFLAG_COUNT; i++)
|
||||
if (npcflags & npcFlagTexts[i].flag)
|
||||
handler->PSendSysMessage(npcFlagTexts[i].text, npcFlagTexts[i].flag);
|
||||
|
||||
|
||||
handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, mechanicImmuneMask);
|
||||
for (uint8 i = 1; i < MAX_MECHANIC; ++i)
|
||||
if (mechanicImmuneMask & (1 << (mechanicImmunes[i].flag - 1)))
|
||||
|
||||
Reference in New Issue
Block a user