aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-10-02 18:51:37 +0200
committerShauren <shauren.trinity@gmail.com>2022-10-02 18:51:37 +0200
commit769591c99ef7bd9c58eacd5c0272387af9a74e4a (patch)
treec8a7c976c357e6e95261ef9b48834d9130ff639d /src
parentf6aa3a05c687de116c134778495080efc79b0ecc (diff)
Core/Spawns: Exclude spawn groups with MANUAL_SPAWN flag from automatic spawning/despawning with conditions
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Maps/Map.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index fc5fa907d84..d828a3f7cbd 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -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);