Core/Battlefields: Refactor Battlefield creation to be linked to host map creation instead of having globally accessible objects

Port From (https://github.com/TrinityCore/TrinityCore/commit/073a036d84365dae60a70064eb67e68f0447bd72)
This commit is contained in:
hondacrx
2022-07-19 20:50:34 -04:00
parent ce16bc0611
commit a27a353d38
16 changed files with 113 additions and 78 deletions
+1 -1
View File
@@ -5731,7 +5731,7 @@ namespace Game.Spells
// allow always ghost flight spells
if (m_originalCaster != null && m_originalCaster.IsTypeId(TypeId.Player) && m_originalCaster.IsAlive())
{
BattleField Bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(m_originalCaster.GetZoneId());
BattleField Bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(m_originalCaster.GetMap(), m_originalCaster.GetZoneId());
var area = CliDB.AreaTableStorage.LookupByKey(m_originalCaster.GetAreaId());
if (area != null)
if (area.HasFlag(AreaFlags.NoFlyZone) || (Bf != null && !Bf.CanFlyIn()))