mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
fix(core/packets): reduce sending unnecessary packets (#13198)
Co-authored-by: Dehravor <dehravor@gmail.com>
This commit is contained in:
@@ -34,15 +34,28 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket& recvData)
|
||||
recvData >> guid;
|
||||
LOG_DEBUG("network", "Inspect Arena stats ({})", guid.ToString());
|
||||
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
if (!player)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ARENA_SLOT; ++i)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetPlayer()->IsWithinDistInMap(player, INSPECT_DISTANCE, false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->IsValidAttackTarget(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < MAX_ARENA_SLOT; ++i)
|
||||
{
|
||||
if (uint32 a_id = player->GetArenaTeamId(i))
|
||||
{
|
||||
if (uint32 a_id = player->GetArenaTeamId(i))
|
||||
{
|
||||
if (ArenaTeam* arenaTeam = sArenaTeamMgr->GetArenaTeamById(a_id))
|
||||
arenaTeam->Inspect(this, player->GetGUID());
|
||||
}
|
||||
if (ArenaTeam* arenaTeam = sArenaTeamMgr->GetArenaTeamById(a_id))
|
||||
arenaTeam->Inspect(this, player->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user