Skip to content

Commit

Permalink
Use OutdoorPvPMgr to save/load capture point data when grid unloads
Browse files Browse the repository at this point in the history
  • Loading branch information
DomGries authored and Schmoozerd committed Aug 17, 2012
1 parent 4b2bdc3 commit 2a5e774
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/game/GameObject.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 2a5e774

Please sign in to comment.