Core/Maps: Properly set initial spawn group state for groups that have conditions

Port From (https://github.com/TrinityCore/TrinityCore/commit/fb64d7fe8efe5ecba40123cdc96195d3ca52d7c0)
This commit is contained in:
hondacrx
2024-02-04 14:49:04 -05:00
parent 5ccf33eabc
commit 00de526f7d
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -2374,6 +2374,13 @@ namespace Game.Maps
return _toggledSpawnGroupIds.Contains(groupId) != !data.flags.HasAnyFlag(SpawnGroupFlags.ManualSpawn);
}
public void InitSpawnGroupState()
{
var spawnGroups = Global.ObjectMgr.GetSpawnGroupsForMap(GetId());
foreach (uint spawnGroupId in spawnGroups)
SetSpawnGroupActive(spawnGroupId, Global.ConditionMgr.IsMapMeetingNotGroupedConditions(ConditionSourceType.SpawnGroup, spawnGroupId, this));
}
public void UpdateSpawnGroupConditions()
{
var spawnGroups = Global.ObjectMgr.GetSpawnGroupsForMap(GetId());