fix(Core/Battlefield): fix stale queue/invite entries and wrong-team kicks (#25168)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d3f1be6d22
commit
b5da3363f1
1 changed files with 4 additions and 2 deletions
|
|
@ -130,6 +130,7 @@ void Battlefield::HandlePlayerLeaveZone(Player* player, uint32 /*zone*/)
|
|||
cp->HandlePlayerLeave(player);
|
||||
|
||||
InvitedPlayers[player->GetTeamId()].erase(player->GetGUID());
|
||||
PlayersInQueue[player->GetTeamId()].erase(player->GetGUID());
|
||||
PlayersWillBeKick[player->GetTeamId()].erase(player->GetGUID());
|
||||
Players[player->GetTeamId()].erase(player->GetGUID());
|
||||
SendRemoveWorldStates(player);
|
||||
|
|
@ -290,7 +291,8 @@ void Battlefield::KickAfkPlayers()
|
|||
void Battlefield::KickPlayerFromBattlefield(ObjectGuid guid)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
if (player->GetZoneId() == GetZoneId() && !player->IsGameMaster())
|
||||
if (player->GetZoneId() == GetZoneId() && !player->IsGameMaster()
|
||||
&& !PlayersInWar[player->GetTeamId()].count(guid))
|
||||
player->TeleportTo(KickPosition);
|
||||
}
|
||||
|
||||
|
|
@ -416,7 +418,7 @@ void Battlefield::PlayerAcceptInviteToWar(Player* player)
|
|||
{
|
||||
player->GetSession()->SendBfEntered(BattleId);
|
||||
PlayersInWar[player->GetTeamId()].insert(player->GetGUID());
|
||||
InvitedPlayers[player->GetTeamId(true)].erase(player->GetGUID());
|
||||
InvitedPlayers[player->GetTeamId()].erase(player->GetGUID());
|
||||
|
||||
if (player->isAFK())
|
||||
player->ToggleAFK();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue