aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp21
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.h1
2 files changed, 20 insertions, 2 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 060326b8d84..e1b37c121a7 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -5738,6 +5738,21 @@ void ObjectMgr::LoadGraveyardZones()
sLog->outString();
}
+WorldSafeLocsEntry const *ObjectMgr::GetDefaultGraveYard(uint32 team)
+{
+ enum DefaultGraveyard
+ {
+ HORDE_GRAVEYARD = 10, // Crossroads
+ ALLIANCE_GRAVEYARD = 4, // Westfall
+ };
+
+ if (team == HORDE)
+ return sWorldSafeLocsStore.LookupEntry(HORDE_GRAVEYARD);
+ else if (team == ALLIANCE)
+ return sWorldSafeLocsStore.LookupEntry(ALLIANCE_GRAVEYARD);
+ else return NULL;
+}
+
WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team)
{
// search for zone associated closest graveyard
@@ -5746,8 +5761,10 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
if (!zoneId)
{
if (z > -500)
+ {
sLog->outError("ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z);
- return NULL;
+ return GetDefaultGraveYard(team);
+ }
}
// Simulate std. algorithm:
@@ -5765,7 +5782,7 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
if (graveLow == graveUp && !map->IsBattleArena())
{
sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
- return NULL;
+ return GetDefaultGraveYard(team);
}
// at corpse map
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 4898727e995..196bce7e9d8 100755
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -704,6 +704,7 @@ class ObjectMgr
GossipText const* GetGossipText(uint32 Text_ID) const;
+ WorldSafeLocsEntry const *GetDefaultGraveYard(uint32 team);
WorldSafeLocsEntry const *GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team);
bool AddGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = true);
void RemoveGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = false);