Core/Pools: Implemented pooling for instances

This commit is contained in:
Shauren authored and Ovahlord committed 2022-12-29 11:56:56 +01:00
1 parent 317a9f2d32
commit 0f0b283168
10 files changed
+320 -200

No files matched your search

+7 -1
View File
@@ -146,6 +146,8 @@ i_scriptLock(false), _respawnCheckTimer(0)
_weatherUpdateTimer.SetInterval(time_t(1 * IN_MILLISECONDS));
_poolData = sPoolMgr->InitPoolsForMap(this);
sTransportMgr->CreateTransportsForMap(this);
MMAP::MMapFactory::createOrGetMMapManager()->loadMapInstance(sWorld->GetDataPath(), GetId(), i_InstanceId);
@@ -1968,7 +1970,7 @@ void Map::ProcessRespawns()
GetRespawnMapForType(next->type).erase(next->spawnId);
// step 2: tell pooling logic to do its thing
sPoolMgr->UpdatePool(poolId, next->type, next->spawnId);
sPoolMgr->UpdatePool(GetPoolData(), poolId, next->type, next->spawnId);
// step 3: get rid of the actual entry
RemoveRespawnTime(next->type, next->spawnId, nullptr, true);
@@ -2062,6 +2064,10 @@ bool Map::ShouldBeSpawnedOnGridLoad(SpawnObjectType type, ObjectGuid::LowType sp
if (!IsSpawnGroupActive(spawnGroup->groupId))
return false;
if (spawnData->ToSpawnData()->poolId)
if (!GetPoolData().IsSpawnedObject(type, spawnId))
return false;
return true;
}