Core/Battlegrounds: Avoid reset BG and Arena scoreboard stats and BG map achievement criterias when relogin if player was already in the BG

Port From (https://github.com/TrinityCore/TrinityCore/commit/1bfbc371d5e2c756da6dc9f658cafcac5779ff60)
This commit is contained in:
hondacrx
2022-05-30 14:30:15 -04:00
parent 69ebe041cf
commit 1eb79de56e
6 changed files with 17 additions and 6 deletions
+3 -1
View File
@@ -45,8 +45,10 @@ namespace Game.Arenas
public override void AddPlayer(Player player)
{
bool isInBattleground = IsPlayerInBattleground(player.GetGUID());
base.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() == Team.Alliance) // gold
{
+2 -1
View File
@@ -1068,7 +1068,8 @@ namespace Game.BattleGrounds
}
// 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);
@@ -221,8 +221,10 @@ namespace Game.BattleGrounds.Zones
public override void AddPlayer(Player player)
{
bool isInBattleground = IsPlayerInBattleground(player.GetGUID());
base.AddPlayer(player);
PlayerScores[player.GetGUID()] = new BattlegroundABScore(player.GetGUID(), player.GetBGTeam());
if (!isInBattleground)
PlayerScores[player.GetGUID()] = new BattlegroundABScore(player.GetGUID(), player.GetBGTeam());
}
public override void RemovePlayer(Player Player, ObjectGuid guid, Team team)
@@ -369,8 +369,10 @@ namespace Game.BattleGrounds.Zones
public override void AddPlayer(Player player)
{
bool isInBattleground = IsPlayerInBattleground(player.GetGUID());
base.AddPlayer(player);
PlayerScores[player.GetGUID()] = new BgEyeOfStormScore(player.GetGUID(), player.GetBGTeam());
if (!isInBattleground)
PlayerScores[player.GetGUID()] = new BgEyeOfStormScore(player.GetGUID(), player.GetBGTeam());
m_PlayersNearPoint[EotSPoints.PointsMax].Add(player.GetGUID());
}
@@ -481,8 +481,10 @@ namespace Game.BattleGrounds.Zones
public override void AddPlayer(Player player)
{
bool isInBattleground = IsPlayerInBattleground(player.GetGUID());
base.AddPlayer(player);
PlayerScores[player.GetGUID()] = new BattlegroundSAScore(player.GetGUID(), player.GetBGTeam());
if (!isInBattleground)
PlayerScores[player.GetGUID()] = new BattlegroundSAScore(player.GetGUID(), player.GetBGTeam());
SendTransportInit(player);
@@ -198,8 +198,10 @@ namespace Game.BattleGrounds.Zones
public override void AddPlayer(Player player)
{
bool isInBattleground = IsPlayerInBattleground(player.GetGUID());
base.AddPlayer(player);
PlayerScores[player.GetGUID()] = new BattlegroundWGScore(player.GetGUID(), player.GetBGTeam());
if (!isInBattleground)
PlayerScores[player.GetGUID()] = new BattlegroundWGScore(player.GetGUID(), player.GetBGTeam());
}
void RespawnFlag(Team Team, bool captured)