From 0de4c02fd22ab7cf359f50c1b97f674b74e30671 Mon Sep 17 00:00:00 2001 From: Triply Date: Sat, 7 Mar 2009 21:31:03 +0100 Subject: [PATCH] [7402] Fixed graveyards in WSG, prevent from cheating. Patch provided by Balrok. Thx. Signed-off-by: Triply --- src/game/BattleGroundWS.cpp | 23 +++++++++++++++++++++++ src/game/BattleGroundWS.h | 7 +++++-- src/shared/revision_nr.h | 2 +- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp index e28be3f34..f6e1b8b95 100644 --- a/src/game/BattleGroundWS.cpp +++ b/src/game/BattleGroundWS.cpp @@ -648,6 +648,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)); diff --git a/src/game/BattleGroundWS.h b/src/game/BattleGroundWS.h index 6a8f5eceb..23ae211a5 100644 --- a/src/game/BattleGroundWS.h +++ b/src/game/BattleGroundWS.h @@ -105,8 +105,10 @@ enum BG_WS_FlagState enum BG_WS_Graveyards { - WS_GRAVEYARD_MAIN_ALLIANCE = 771, - WS_GRAVEYARD_MAIN_HORDE = 772 + WS_GRAVEYARD_FLAGROOM_ALLIANCE = 769, + WS_GRAVEYARD_FLAGROOM_HORDE = 770, + WS_GRAVEYARD_MAIN_ALLIANCE = 771, + WS_GRAVEYARD_MAIN_HORDE = 772 }; enum BG_WS_CreatureTypes @@ -162,6 +164,7 @@ class BattleGroundWS : public BattleGround void HandleKillPlayer(Player *player, Player *killer); bool SetupBattleGround(); virtual void Reset(); + virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); void UpdateFlagState(uint32 team, uint32 value); void UpdateTeamScore(uint32 team); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 0cbbe03d1..407f659f9 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7401" + #define REVISION_NR "7402" #endif // __REVISION_NR_H__