aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGildor <gildor55@gmail.com>2021-12-15 19:36:56 +0100
committerShauren <shauren.trinity@gmail.com>2022-03-24 11:48:37 +0100
commit1bfbc371d5e2c756da6dc9f658cafcac5779ff60 (patch)
treebd91a555e1b0c0487a3bca35b36c87f21f107cc1
parentcc94b595cfea17e2f524cad402b99f9db9909982 (diff)
Core/Battlegrounds: Avoid reset BG and Arena scoreboard stats and BG map achievement criterias when relogin if player was already in the BG (#27280)
(cherry picked from commit fade6fbf4fab1c520de72417cbfb1c7a6dc69c32)
-rw-r--r--src/server/game/Battlegrounds/Arena.cpp4
-rw-r--r--src/server/game/Battlegrounds/Battleground.cpp3
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp4
8 files changed, 23 insertions, 8 deletions
diff --git a/src/server/game/Battlegrounds/Arena.cpp b/src/server/game/Battlegrounds/Arena.cpp
index ec3370a67a7..17557902df2 100644
--- a/src/server/game/Battlegrounds/Arena.cpp
+++ b/src/server/game/Battlegrounds/Arena.cpp
@@ -42,8 +42,10 @@ Arena::Arena(BattlegroundTemplate const* battlegroundTemplate) : Battleground(ba
void Arena::AddPlayer(Player* player)
{
+ bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
Battleground::AddPlayer(player);
- PlayerScores[player->GetGUID()] = new ArenaScore(player->GetGUID(), player->GetBGTeam());
+ if (!isInBattleground)
+ PlayerScores[player->GetGUID()] = new ArenaScore(player->GetGUID(), player->GetBGTeam());
if (player->GetBGTeam() == ALLIANCE) // gold
{
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 8bf9867a4d3..715c497fa30 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1121,7 +1121,8 @@ void Battleground::AddPlayer(Player* player)
}
// reset all map criterias on map enter
- player->ResetCriteria(CriteriaFailEvent::LeaveBattleground, GetMapId(), true);
+ if (!isInBattleground)
+ player->ResetCriteria(CriteriaFailEvent::LeaveBattleground, GetMapId(), true);
// setup BG group membership
PlayerAddedToBGCheckIfBGIsRunning(player);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
index 0baf5d34416..436f91169dc 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
@@ -222,8 +222,10 @@ void BattlegroundAB::StartingEventOpenDoors()
void BattlegroundAB::AddPlayer(Player* player)
{
+ bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
Battleground::AddPlayer(player);
- PlayerScores[player->GetGUID()] = new BattlegroundABScore(player->GetGUID(), player->GetBGTeam());
+ if (!isInBattleground)
+ PlayerScores[player->GetGUID()] = new BattlegroundABScore(player->GetGUID(), player->GetBGTeam());
}
void BattlegroundAB::RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index 9d792110c1c..1a32b3ed93b 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -436,8 +436,10 @@ void BattlegroundAV::StartingEventOpenDoors()
void BattlegroundAV::AddPlayer(Player* player)
{
+ bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
Battleground::AddPlayer(player);
- PlayerScores[player->GetGUID()] = new BattlegroundAVScore(player->GetGUID(), player->GetBGTeam());
+ if (!isInBattleground)
+ PlayerScores[player->GetGUID()] = new BattlegroundAVScore(player->GetGUID(), player->GetBGTeam());
}
void BattlegroundAV::EndBattleground(uint32 winner)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
index 803b7a4e46c..f411457d6f4 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
@@ -380,8 +380,10 @@ void BattlegroundEY::UpdatePointsIcons(uint32 Team, uint32 Point)
void BattlegroundEY::AddPlayer(Player* player)
{
+ bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
Battleground::AddPlayer(player);
- PlayerScores[player->GetGUID()] = new BattlegroundEYScore(player->GetGUID(), player->GetBGTeam());
+ if (!isInBattleground)
+ PlayerScores[player->GetGUID()] = new BattlegroundEYScore(player->GetGUID(), player->GetBGTeam());
m_PlayersNearPoint[EY_POINTS_MAX].push_back(player->GetGUID());
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
index e1d6f457da8..d826794b178 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
@@ -242,8 +242,10 @@ void BattlegroundIC::StartingEventOpenDoors()
void BattlegroundIC::AddPlayer(Player* player)
{
+ bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
Battleground::AddPlayer(player);
- PlayerScores[player->GetGUID()] = new BattlegroundICScore(player->GetGUID(), player->GetBGTeam());
+ if (!isInBattleground)
+ PlayerScores[player->GetGUID()] = new BattlegroundICScore(player->GetGUID(), player->GetBGTeam());
if (nodePoint[NODE_TYPE_QUARRY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
player->CastSpell(player, SPELL_QUARRY, true);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index 2f6cd190f72..7608957f1a2 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -476,8 +476,10 @@ void BattlegroundSA::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS
void BattlegroundSA::AddPlayer(Player* player)
{
+ bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
Battleground::AddPlayer(player);
- PlayerScores[player->GetGUID()] = new BattlegroundSAScore(player->GetGUID(), player->GetBGTeam());
+ if (!isInBattleground)
+ PlayerScores[player->GetGUID()] = new BattlegroundSAScore(player->GetGUID(), player->GetBGTeam());
SendTransportInit(player);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
index 758b5188fe4..eaa8d4f3898 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
@@ -228,8 +228,10 @@ void BattlegroundWS::StartingEventOpenDoors()
void BattlegroundWS::AddPlayer(Player* player)
{
+ bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
Battleground::AddPlayer(player);
- PlayerScores[player->GetGUID()] = new BattlegroundWGScore(player->GetGUID(), player->GetBGTeam());
+ if (!isInBattleground)
+ PlayerScores[player->GetGUID()] = new BattlegroundWGScore(player->GetGUID(), player->GetBGTeam());
}
void BattlegroundWS::RespawnFlag(uint32 Team, bool captured)