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

This commit is contained in:
Shauren
2022-07-19 23:18:19 +02:00
parent 83b3266794
commit 073a036d84
21 changed files with 160 additions and 114 deletions

View File

@@ -1408,7 +1408,7 @@ public:
nearestLoc = bg->GetClosestGraveyard(player);
else
{
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId()))
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetMap(), player->GetZoneId()))
nearestLoc = bf->GetClosestGraveyard(player);
else
nearestLoc = sObjectMgr->GetClosestGraveyard(*player, player->GetTeam(), player);