mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(Core/Battlefield): fix stale queue/invite entries and wrong-team kicks (#25168)
Co-authored-by: Claude Opus 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d3f1be6d22
commit
b5da3363f1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user