diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 1e8146891b9..7f0922b1b9e 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -17,6 +17,7 @@ #include "BattlegroundWS.h" #include "BattlegroundMgr.h" +#include "DB2Stores.h" #include "GameObject.h" #include "GameTime.h" #include "Log.h" @@ -514,6 +515,11 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* player, GameObject* target PlaySoundToAll(BG_WS_SOUND_FLAG_RETURNED); UpdatePlayerScore(player, SCORE_FLAG_RETURNS, 1); _bothFlagsKept = false; + + // Check Horde flag if it is in capture zone; if so, capture it + if (Player* hordeFlagCarrier = ObjectAccessor::GetPlayer(GetBgMap(), GetFlagPickerGUID(TEAM_HORDE))) + if (hordeFlagCarrier->IsInAreaTriggerRadius(sAreaTriggerStore.LookupEntry(3646))) + EventPlayerCapturedFlag(hordeFlagCarrier); } else { @@ -546,6 +552,11 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* player, GameObject* target PlaySoundToAll(BG_WS_SOUND_FLAG_RETURNED); UpdatePlayerScore(player, SCORE_FLAG_RETURNS, 1); _bothFlagsKept = false; + + // Check Alliance flag if it is in capture zone; if so, capture it + if (Player* allianceFlagCarrier = ObjectAccessor::GetPlayer(GetBgMap(), GetFlagPickerGUID(TEAM_ALLIANCE))) + if (allianceFlagCarrier->IsInAreaTriggerRadius(sAreaTriggerStore.LookupEntry(3647))) + EventPlayerCapturedFlag(allianceFlagCarrier); } else { |