aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-08 11:53:35 -0600
committermegamage <none@none>2009-03-08 11:53:35 -0600
commit56416558fadae5fa160c34280760c5c9883c68f2 (patch)
tree2c17baf561a545e3c5f53f9bbbb319a286d5a099 /src
parentd33a69921b886bb1f44800c0a870d1dbc5e6c4f8 (diff)
[7402] Fixed graveyards in WSG, prevent from cheating. Patch provided by Balrok.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/BattleGroundWS.cpp23
-rw-r--r--src/game/BattleGroundWS.h7
-rw-r--r--src/shared/revision_nr.h2
3 files changed, 29 insertions, 3 deletions
diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp
index a5dd3f13a1c..57de5909645 100644
--- a/src/game/BattleGroundWS.cpp
+++ b/src/game/BattleGroundWS.cpp
@@ -671,6 +671,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 f86fc4c637e..f551cda1884 100644
--- a/src/game/BattleGroundWS.h
+++ b/src/game/BattleGroundWS.h
@@ -116,8 +116,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
@@ -177,6 +179,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 0cbbe03d19d..407f659f96f 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__