mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
Use OutdoorPvPMgr to save/load capture point data when grid unloads
This commit is contained in:
parent
dafd0adac1
commit
525ec3ea4c
1 changed files with 6 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue