aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoderKane <97305199+CoderKane@users.noreply.github.com>2022-08-02 15:03:12 -0500
committerShauren <shauren.trinity@gmail.com>2022-09-05 22:23:00 +0200
commitbd74524d4c150c5dbaac850a8965d2953953a8f6 (patch)
tree23093bb09bf098b866828d29c66e8baf1b82af8f
parent98e0acd76812a145f314c97209fdbbd3d441fa41 (diff)
Core/Battlegrounds: Capture flags immediately when standing on capture point and your team's flag gets returned (#28087)
Closes #28076 (cherry picked from commit 2ad36c37b430694dfa61f43fb7c135037423bdb2)
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp11
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
{