Core/BattlegroundMap: Load all cells when created & mark all creatures as active

Port From (https://github.com/TrinityCore/TrinityCore/commit/e72bde5236d41a7f66abb25ce9e118eeb1c5aa92)
This commit is contained in:
hondacrx
2024-02-03 11:15:25 -05:00
parent 7557fac40c
commit 226e12890e
5 changed files with 27 additions and 0 deletions
+12
View File
@@ -423,6 +423,9 @@ namespace Game.Maps
return false; //Should delete object
}
if (IsAlwaysActive())
obj.SetActive(true);
var cell = new Cell(cellCoord);
if (obj.IsActiveObject())
EnsureGridLoadedForActiveObject(cell, obj);
@@ -3345,6 +3348,15 @@ namespace Game.Maps
return i_mapRecord != null && i_mapRecord.IsGarrison();
}
/// <summary>
/// Currently, this means that every entity added to this map will be marked as active
/// </summary>
/// <returns></returns>
bool IsAlwaysActive()
{
return IsBattlegroundOrArena();
}
private bool GetEntrancePos(out uint mapid, out float x, out float y)
{
mapid = 0;