diff options
Diffstat (limited to 'src/game/BattleGroundWS.cpp')
-rw-r--r-- | src/game/BattleGroundWS.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp index a5dd3f13a1c..6aa16d3dff1 100644 --- a/src/game/BattleGroundWS.cpp +++ b/src/game/BattleGroundWS.cpp @@ -25,7 +25,6 @@ #include "Creature.h" #include "GameObject.h" #include "Chat.h" -#include "MapManager.h" #include "ObjectMgr.h" #include "WorldPacket.h" #include "Language.h" @@ -671,6 +670,29 @@ void BattleGroundWS::UpdatePlayerScore(Player *Source, uint32 type, uint32 value } } +WorldSafeLocsEntry const* BattleGroundWS::GetClosestGraveYard(Player* player) +{ + //if status in progress, it returns main graveyards with spiritguides + //else it will return the graveyard in the flagroom - this is especially good + //if a player dies in preparation phase - then the player can't cheat + //and teleport to the graveyard outside the flagroom + //and start running around, while the doors are still closed + if(player->GetTeam() == ALLIANCE) + { + if(GetStatus() == STATUS_IN_PROGRESS) + return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE); + else + return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_FLAGROOM_ALLIANCE); + } + else + { + if(GetStatus() == STATUS_IN_PROGRESS) + return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE); + else + return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_FLAGROOM_HORDE); + } +} + void BattleGroundWS::FillInitialWorldStates(WorldPacket& data) { data << uint32(BG_WS_FLAG_CAPTURES_ALLIANCE) << uint32(GetTeamScore(ALLIANCE)); |