fix(Core/Battlegrounds): don't block BG entry on a stale charm reference (#26487)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Andrew
2026-07-08 20:34:14 -03:00
committed by GitHub
parent 0f107f2cd4
commit edb3730f7a
2 changed files with 6 additions and 2 deletions

View File

@@ -2257,7 +2257,9 @@ namespace lfg
{
error = LFG_TELEPORTERROR_IN_VEHICLE;
}
else if (player->GetCharmGUID() || player->IsInCombat())
// GetCharm() validates the charmed unit still exists and clears a stale reference,
// unlike GetCharmGUID(); a despawned vehicle must not permanently block the teleport.
else if (player->GetCharm() || player->IsInCombat())
{
error = LFG_TELEPORTERROR_COMBAT;
}

View File

@@ -412,7 +412,9 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recvData)
return;
}
if (_player->GetCharmGUID() || _player->IsInCombat())
// GetCharm() validates the charmed unit still exists and clears a stale reference,
// unlike GetCharmGUID(); a despawned vehicle must not permanently block BG entry.
if (_player->GetCharm() || _player->IsInCombat())
{
ChatHandler(_player->GetSession()).SendNotification(LANG_YOU_IN_COMBAT);
return;