diff options
author | leak <none@none> | 2010-12-06 20:55:26 +0100 |
---|---|---|
committer | leak <none@none> | 2010-12-06 20:55:26 +0100 |
commit | 20cc4ace5d4ab8a7438fc5db470c43cd9b1f4c66 (patch) | |
tree | 5a57d4d69dedbb2ad5422cd7e0b3b68a2ce2ccc5 /src | |
parent | 3ae225247a8f6094883239cdb8836f23f2ad3321 (diff) |
Core/OutdoorPvP: Fixed a crash that occured on accessing CapturePoints after GO removal
--HG--
branch : trunk
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/OutdoorPvP/OutdoorPvP.cpp | 9 | ||||
-rwxr-xr-x | src/server/game/OutdoorPvP/OutdoorPvP.h | 1 |
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 |