mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Battlegrounds: Avoid reset BG and Arena scoreboard stats and BG map achievement criterias when relogin if player was already in the BG (#27280)
This commit is contained in:
@@ -73,8 +73,10 @@ Arena::Arena()
|
||||
|
||||
void Arena::AddPlayer(Player* player)
|
||||
{
|
||||
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
|
||||
Battleground::AddPlayer(player);
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new ArenaScore(player->GetGUID(), player->GetBGTeam());
|
||||
if (!isInBattleground)
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new ArenaScore(player->GetGUID(), player->GetBGTeam());
|
||||
|
||||
if (player->GetBGTeam() == ALLIANCE) // gold
|
||||
{
|
||||
|
||||
@@ -1024,7 +1024,8 @@ void Battleground::AddPlayer(Player* player)
|
||||
}
|
||||
|
||||
// reset all map criterias on map enter
|
||||
player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
|
||||
if (!isInBattleground)
|
||||
player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
|
||||
|
||||
// setup BG group membership
|
||||
PlayerAddedToBGCheckIfBGIsRunning(player);
|
||||
|
||||
@@ -230,8 +230,10 @@ void BattlegroundAB::StartingEventOpenDoors()
|
||||
|
||||
void BattlegroundAB::AddPlayer(Player* player)
|
||||
{
|
||||
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
|
||||
Battleground::AddPlayer(player);
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundABScore(player->GetGUID());
|
||||
if (!isInBattleground)
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundABScore(player->GetGUID());
|
||||
}
|
||||
|
||||
void BattlegroundAB::RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/)
|
||||
|
||||
@@ -446,8 +446,10 @@ void BattlegroundAV::StartingEventOpenDoors()
|
||||
|
||||
void BattlegroundAV::AddPlayer(Player* player)
|
||||
{
|
||||
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
|
||||
Battleground::AddPlayer(player);
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundAVScore(player->GetGUID());
|
||||
if (!isInBattleground)
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundAVScore(player->GetGUID());
|
||||
}
|
||||
|
||||
void BattlegroundAV::EndBattleground(uint32 winner)
|
||||
|
||||
@@ -358,8 +358,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().GetCounter()] = new BattlegroundEYScore(player->GetGUID());
|
||||
if (!isInBattleground)
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundEYScore(player->GetGUID());
|
||||
|
||||
m_PlayersNearPoint[EY_POINTS_MAX].push_back(player->GetGUID());
|
||||
}
|
||||
|
||||
@@ -248,8 +248,10 @@ void BattlegroundIC::StartingEventOpenDoors()
|
||||
|
||||
void BattlegroundIC::AddPlayer(Player* player)
|
||||
{
|
||||
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
|
||||
Battleground::AddPlayer(player);
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundICScore(player->GetGUID());
|
||||
if (!isInBattleground)
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundICScore(player->GetGUID());
|
||||
|
||||
if (nodePoint[NODE_TYPE_QUARRY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
|
||||
player->CastSpell(player, SPELL_QUARRY, true);
|
||||
|
||||
@@ -482,8 +482,10 @@ void BattlegroundSA::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS
|
||||
|
||||
void BattlegroundSA::AddPlayer(Player* player)
|
||||
{
|
||||
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
|
||||
Battleground::AddPlayer(player);
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundSAScore(player->GetGUID());
|
||||
if (!isInBattleground)
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundSAScore(player->GetGUID());
|
||||
|
||||
SendTransportInit(player);
|
||||
|
||||
|
||||
@@ -235,8 +235,10 @@ void BattlegroundWS::StartingEventOpenDoors()
|
||||
|
||||
void BattlegroundWS::AddPlayer(Player* player)
|
||||
{
|
||||
bool const isInBattleground = IsPlayerInBattleground(player->GetGUID());
|
||||
Battleground::AddPlayer(player);
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundWGScore(player->GetGUID());
|
||||
if (!isInBattleground)
|
||||
PlayerScores[player->GetGUID().GetCounter()] = new BattlegroundWGScore(player->GetGUID());
|
||||
}
|
||||
|
||||
void BattlegroundWS::RespawnFlag(uint32 Team, bool captured)
|
||||
|
||||
Reference in New Issue
Block a user