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

This commit is contained in:
Shauren
2022-10-02 18:51:37 +02:00
parent f6aa3a05c6
commit 769591c99e
+5 -1
View File
@@ -2473,6 +2473,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)
@@ -2480,7 +2484,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);