aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOvah <dreadkiller@gmx.de>2021-07-24 14:49:21 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-11 19:28:56 +0100
commit21177487ea9476cb4db3f498353c340181d87e14 (patch)
tree265b392fff3cbac3a9a8f25b5ab1295e1848dd35 /src
parent78e462cbeceb23fdb818395f4960fd0127badb38 (diff)
Core/Spawns: prevent spawn groups from bypassing spawnMask restrictions (#26711)
* spawn groups have been able to spawn for all difficulties even when they should be restricted to a single difficulty only (cherry picked from commit 48f63eda9029d4fe16b7a350059c8e26ba8484ce)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Maps/Map.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index de95c08b4ac..dcf634ae3a7 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -3543,6 +3543,10 @@ bool Map::SpawnGroupSpawn(uint32 groupId, bool ignoreRespawn, bool force, std::v
for (SpawnData const* data : toSpawn)
{
+ // don't spawn if the current map difficulty is not used by the spawn
+ if (std::find(data->spawnDifficulties.begin(), data->spawnDifficulties.end(), GetDifficultyID()) == data->spawnDifficulties.end())
+ continue;
+
// don't spawn if the grid isn't loaded (will be handled in grid loader)
if (!IsGridLoaded(data->spawnPoint))
continue;