Core/Spawns: Exclude spawn groups with MANUAL_SPAWN flag from automatic spawning/despawning with conditions

This commit is contained in:
Shauren authored and Ovahlord committed 2022-12-29 22:51:30 +01:00
1 parent 82fe2ab194
commit 4500ee8284
1 file changed
+5 -1
+5 -1
View File
@@ -2289,6 +2289,10 @@ void Map::UpdateSpawnGroupConditions()
for (uint32 spawnGroupId : *spawnGroups)
{
SpawnGroupTemplateData const* spawnGroupTemplate = ASSERT_NOTNULL(GetSpawnGroupData(spawnGroupId));
if (spawnGroupTemplate->flags & SPAWNGROUP_FLAG_MANUAL_SPAWN)
continue;
bool isActive = IsSpawnGroupActive(spawnGroupId);
bool shouldBeActive = sConditionMgr->IsMapMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_SPAWN_GROUP, spawnGroupId, this);
if (isActive == shouldBeActive)
@@ -2296,7 +2300,7 @@ void Map::UpdateSpawnGroupConditions()
if (shouldBeActive)
SpawnGroupSpawn(spawnGroupId);
else if (ASSERT_NOTNULL(GetSpawnGroupData(spawnGroupId))->flags & SPAWNGROUP_FLAG_DESPAWN_ON_CONDITION_FAILURE)
else if (spawnGroupTemplate->flags & SPAWNGROUP_FLAG_DESPAWN_ON_CONDITION_FAILURE)
SpawnGroupDespawn(spawnGroupId, true);
else
SetSpawnGroupInactive(spawnGroupId);