Core/OutdoorPvP: Fixed a crash that occured on accessing CapturePoints after GO removal

--HG--
branch : trunk
This commit is contained in:
leak
2010-12-06 20:55:26 +01:00
parent 3ae225247a
commit 20cc4ace5d
2 changed files with 10 additions and 0 deletions

View File

@@ -598,3 +598,12 @@ void OutdoorPvP::OnGameObjectCreate(GameObject *go)
if (OPvPCapturePoint *cp = GetCapturePoint(go->GetDBTableGUIDLow()))
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;
}

View File

@@ -220,6 +220,7 @@ class OutdoorPvP : public ZoneScript
virtual bool SetupOutdoorPvP() {return true;}
void OnGameObjectCreate(GameObject *go);
void OnGameObjectRemove(GameObject *go);
void OnCreatureCreate(Creature *) {}
// send world state update to all players present