Core/Battlefields: Refactor Battlefield creation to be linked to host map creation instead of having globally accessible objects
This commit is contained in:
1 parent
28ad85c160
commit
265c2fa508
22 files changed
+253
-192
No files matched your search
@@ -718,7 +718,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId());
|
||||
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetMap(), player->GetZoneId());
|
||||
if (!Bf || Bf->CanFlyIn() || (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY)))
|
||||
return false;
|
||||
break;
|
||||
@@ -729,7 +729,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId());
|
||||
Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetMap(), player->GetZoneId());
|
||||
|
||||
if (!bf || bf->GetTypeId() != BATTLEFIELD_WG)
|
||||
return false;
|
||||
@@ -749,7 +749,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
if (Battlefield* battlefieldWG = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
|
||||
if (Battlefield* battlefieldWG = sBattlefieldMgr->GetBattlefieldByBattleId(player->GetMap(), BATTLEFIELD_BATTLEID_WG))
|
||||
return battlefieldWG->IsEnabled() && (player->GetTeamId() == battlefieldWG->GetDefenderTeam()) && !battlefieldWG->IsWarTime();
|
||||
break;
|
||||
}
|
||||
@@ -758,7 +758,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId()))
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetMap(), player->GetZoneId()))
|
||||
return bf->IsWarTime();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user