aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorleak <none@none>2010-12-06 20:55:26 +0100
committerleak <none@none>2010-12-06 20:55:26 +0100
commit20cc4ace5d4ab8a7438fc5db470c43cd9b1f4c66 (patch)
tree5a57d4d69dedbb2ad5422cd7e0b3b68a2ce2ccc5 /src
parent3ae225247a8f6094883239cdb8836f23f2ad3321 (diff)
Core/OutdoorPvP: Fixed a crash that occured on accessing CapturePoints after GO removal
--HG-- branch : trunk
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvP.cpp9
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvP.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
index 878cc3325f7..af543c27ea8 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
@@ -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;
+}
diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h
index a66c3c129fd..406f5ec9c51 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvP.h
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.h
@@ -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