fix(Core/Battlefield): Wintergrasp Workshops SW/SE (#14104)

* Now only SW and SE are owned by Attacker, the rest are for Defender team

Co-authored-by: M'Dic <joshua.lee.betts@gmail.com>
This commit is contained in:
Pedro Antonio
2023-03-17 15:26:54 +01:00
committed by GitHub
parent 0f2f86171a
commit 307d09877a
3 changed files with 22 additions and 10 deletions

View File

@@ -917,10 +917,13 @@ void BfCapturePoint::SendChangePhase()
}
}
bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint)
bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint, TeamId team)
{
ASSERT(capturePoint);
//At first call using TEAM_NEUTRAL as a checker but never using it, after first call we reset the capturepoints to the new winner of the last WG war
if (team == TEAM_NEUTRAL)
team = m_team;
LOG_DEBUG("bg.battlefield", "Creating capture point {}", capturePoint->GetEntry());
m_capturePoint = capturePoint->GetGUID();
@@ -939,7 +942,7 @@ bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint)
m_neutralValuePct = goinfo->capturePoint.neutralPercent;
m_minValue = m_maxValue * goinfo->capturePoint.neutralPercent / 100;
m_capturePointEntry = capturePoint->GetEntry();
if (m_team == TEAM_ALLIANCE)
if (team == TEAM_ALLIANCE)
{
m_value = m_maxValue;
m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE;