mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Pools: Implemented pooling for instances
This commit is contained in:
@@ -365,6 +365,8 @@ i_scriptLock(false), _respawnCheckTimer(0)
|
||||
|
||||
GetGuidSequenceGenerator<HighGuid::Transport>().Set(sObjectMgr->GetGenerator<HighGuid::Transport>().GetNextAfterMaxUsed());
|
||||
|
||||
_poolData = sPoolMgr->InitPoolsForMap(this);
|
||||
|
||||
MMAP::MMapFactory::createOrGetMMapManager()->loadMapInstance(sWorld->GetDataPath(), GetId(), i_InstanceId);
|
||||
|
||||
sScriptMgr->OnCreateMap(this);
|
||||
@@ -3392,7 +3394,7 @@ void Map::ProcessRespawns()
|
||||
ASSERT_NOTNULL(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);
|
||||
@@ -3485,6 +3487,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user