Core/Maps: Properly set initial spawn group state for groups that have conditions (#29509)

This commit is contained in:
Jeremy
2023-12-29 14:02:37 +01:00
committed by GitHub
parent a2be97414b
commit fb64d7fe8e
3 changed files with 15 additions and 0 deletions

View File

@@ -2452,6 +2452,16 @@ bool Map::IsSpawnGroupActive(uint32 groupId) const
return (_toggledSpawnGroupIds.find(groupId) != _toggledSpawnGroupIds.end()) != !(data->flags & SPAWNGROUP_FLAG_MANUAL_SPAWN);
}
void Map::InitSpawnGroupState()
{
std::vector<uint32> const* spawnGroups = sObjectMgr->GetSpawnGroupsForMap(GetId());
if (!spawnGroups)
return;
for (uint32 spawnGroupId : *spawnGroups)
SetSpawnGroupActive(spawnGroupId, sConditionMgr->IsMapMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_SPAWN_GROUP, spawnGroupId, this));
}
void Map::UpdateSpawnGroupConditions()
{
std::vector<uint32> const* spawnGroups = sObjectMgr->GetSpawnGroupsForMap(GetId());