Core/OutdoorPvP: Fixed a crash that occured on accessing CapturePoints after GO removal
--HG-- branch : trunk
This commit is contained in:
@@ -598,3 +598,12 @@ void OutdoorPvP::OnGameObjectCreate(GameObject *go)
|
|||||||
if (OPvPCapturePoint *cp = GetCapturePoint(go->GetDBTableGUIDLow()))
|
if (OPvPCapturePoint *cp = GetCapturePoint(go->GetDBTableGUIDLow()))
|
||||||
cp->m_capturePoint = go;
|
cp->m_capturePoint = go;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OutdoorPvP::OnGameObjectRemove(GameObject *go)
|
||||||
|
{
|
||||||
|
if (go->GetGoType() != GAMEOBJECT_TYPE_CAPTURE_POINT)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (OPvPCapturePoint *cp = GetCapturePoint(go->GetDBTableGUIDLow()))
|
||||||
|
cp->m_capturePoint = NULL;
|
||||||
|
}
|
||||||
|
|||||||
@@ -220,6 +220,7 @@ class OutdoorPvP : public ZoneScript
|
|||||||
virtual bool SetupOutdoorPvP() {return true;}
|
virtual bool SetupOutdoorPvP() {return true;}
|
||||||
|
|
||||||
void OnGameObjectCreate(GameObject *go);
|
void OnGameObjectCreate(GameObject *go);
|
||||||
|
void OnGameObjectRemove(GameObject *go);
|
||||||
void OnCreatureCreate(Creature *) {}
|
void OnCreatureCreate(Creature *) {}
|
||||||
|
|
||||||
// send world state update to all players present
|
// send world state update to all players present
|
||||||
|
|||||||
Reference in New Issue
Block a user