Core/Wintergrasp: fix ownership of workshops at the beginning of a new battle.

Those two, together with the two workshop in the Keep, always belong to the defender team. The SouthEast and SouthWest ones always belong to the attacker team.

(cherry picked from commit b8bb1545ec)
This commit is contained in:
SnapperRy
2016-10-09 00:18:42 +02:00
committed by joschiwald
parent fa06aad708
commit d9ababbc2c
2 changed files with 5 additions and 5 deletions

View File

@@ -482,7 +482,7 @@ bool BattlefieldWG::SetupBattlefield()
for (uint8 i = 0; i < WG_MAX_WORKSHOP; i++)
{
WintergraspWorkshop* workshop = new WintergraspWorkshop(this, i);
if (i < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
if (i < BATTLEFIELD_WG_WORKSHOP_NE)
workshop->GiveControlTo(GetAttackerTeam(), true);
else
workshop->GiveControlTo(GetDefenderTeam(), true);
@@ -1810,8 +1810,8 @@ void WintergraspWorkshop::GiveControlTo(TeamId teamId, bool init /*= false*/)
void WintergraspWorkshop::UpdateGraveyardAndWorkshop()
{
if (_staticInfo->WorkshopId < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
_wg->GetGraveyardById(_staticInfo->WorkshopId)->GiveControlTo(_teamControl);
if (_staticInfo->WorkshopId < BATTLEFIELD_WG_WORKSHOP_NE)
GiveControlTo(_wg->GetAttackerTeam(), true);
else
GiveControlTo(_wg->GetDefenderTeam(), true);
}

View File

@@ -436,10 +436,10 @@ enum WintergraspTowerIds
enum WintergraspWorkshopIds
{
BATTLEFIELD_WG_WORKSHOP_NE,
BATTLEFIELD_WG_WORKSHOP_NW,
BATTLEFIELD_WG_WORKSHOP_SE,
BATTLEFIELD_WG_WORKSHOP_SW,
BATTLEFIELD_WG_WORKSHOP_NE,
BATTLEFIELD_WG_WORKSHOP_NW,
BATTLEFIELD_WG_WORKSHOP_KEEP_WEST,
BATTLEFIELD_WG_WORKSHOP_KEEP_EAST
};