diff options
author | Manuel Carrasco <manue.l@live.com.ar> | 2012-03-04 01:24:00 -0300 |
---|---|---|
committer | Kandera <KanderaDev@gmail.com> | 2012-08-20 13:48:47 -0400 |
commit | 27bfafe0e15ab07b98f3684c6f3ae98100cab1c2 (patch) | |
tree | 876b9cc41a079082c05c0ac6dd249f61b6716f51 /src/server/game/Battlefield/Battlefield.cpp | |
parent | d7a7a9800b734f71074da84338ba29a93009a198 (diff) |
BF/Wintergrasp: Removed harcoded Workshops related spawns, db data is used now.
Diffstat (limited to 'src/server/game/Battlefield/Battlefield.cpp')
-rw-r--r-- | src/server/game/Battlefield/Battlefield.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index f9c4e4736d4..b0bf1a41669 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -944,40 +944,40 @@ void BfCapturePoint::SendChangePhase() SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct); } -bool BfCapturePoint::SetCapturePointData(uint32 entry, uint32 /*map */ , float x, float y, float z, float o) +bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint) { - sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Creating capture point %u", entry); + ASSERT(capturePoint); + + sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Creating capture point %u", capturePoint->GetEntry()); + + m_capturePoint = capturePoint; // check info existence - GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry); + GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(capturePoint->GetEntry()); if (!goinfo || goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT) { - sLog->outError("OutdoorPvP: GO %u is not capture point!", entry); + sLog->outError("OutdoorPvP: GO %u is not capture point!", capturePoint->GetEntry()); return false; } - m_capturePoint = m_Bf->SpawnGameObject(entry, x, y, z, o); - if (m_capturePoint) + + // get the needed values from goinfo + m_maxValue = goinfo->capturePoint.maxTime; + m_maxSpeed = m_maxValue / (goinfo->capturePoint.minTime ? goinfo->capturePoint.minTime : 60); + m_neutralValuePct = goinfo->capturePoint.neutralPercent; + m_minValue = m_maxValue * goinfo->capturePoint.neutralPercent / 100; + m_capturePointEntry = capturePoint->GetEntry(); + if (m_team == TEAM_ALLIANCE) { - // get the needed values from goinfo - m_maxValue = goinfo->capturePoint.maxTime; - m_maxSpeed = m_maxValue / (goinfo->capturePoint.minTime ? goinfo->capturePoint.minTime : 60); - m_neutralValuePct = goinfo->capturePoint.neutralPercent; - m_minValue = m_maxValue * goinfo->capturePoint.neutralPercent / 100; - m_capturePointEntry = entry; - if (m_team == TEAM_ALLIANCE) - { - m_value = m_maxValue; - m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE; - } - else - { - m_value = -m_maxValue; - m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE; - } - return true; + m_value = m_maxValue; + m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE; + } + else + { + m_value = -m_maxValue; + m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE; } - return false; + return true; } bool BfCapturePoint::DelCapturePoint() |