diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index db53ab6e5..dc778b4c8 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -36,6 +36,7 @@ #include "MapPersistentStateMgr.h" #include "BattleGround.h" #include "BattleGroundAV.h" +#include "OutdoorPvP/OutdoorPvP.h" #include "Util.h" #include "ScriptMgr.h" #include "SQLStorages.h" @@ -69,6 +70,10 @@ GameObject::GameObject() : WorldObject(), GameObject::~GameObject() { + // store the capture point slider value (for non visual, non locked capture points) + GameObjectInfo const* goInfo = GetGOInfo(); + if (goInfo && goInfo->type == GAMEOBJECT_TYPE_CAPTURE_POINT && goInfo->capturePoint.radius && m_lootState == GO_ACTIVATED) + sOutdoorPvPMgr.SetCapturePointSlider(GetEntry(), m_captureSlider); } void GameObject::AddToWorld() @@ -159,7 +164,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa // set initial data and activate non visual-only capture points if (goinfo->type == GAMEOBJECT_TYPE_CAPTURE_POINT && goinfo->capturePoint.radius) - SetCapturePointSlider(CAPTURE_SLIDER_NEUTRAL); + SetCapturePointSlider(sOutdoorPvPMgr.GetCapturePointSliderValue(goinfo->id)); // Notify the map's instance data. // Only works if you create the object in it, not if it is moves to that map.