mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
BG crash fix: Fixed a crash when the bot was marked as being inside a battleground but had no battleground. (#1122)
This commit is contained in:
@@ -21,6 +21,9 @@ Unit* FlagCarrierValue::Calculate()
|
||||
{
|
||||
BattlegroundWS* bg = (BattlegroundWS*)botAI->GetBot()->GetBattleground();
|
||||
|
||||
if (!bg)
|
||||
return nullptr;
|
||||
|
||||
if ((!sameTeam && bot->GetTeamId() == TEAM_HORDE || (sameTeam && bot->GetTeamId() == TEAM_ALLIANCE)) &&
|
||||
!bg->GetFlagPickerGUID(TEAM_HORDE).IsEmpty())
|
||||
carrier = ObjectAccessor::GetPlayer(bg->GetBgMap(), bg->GetFlagPickerGUID(TEAM_HORDE));
|
||||
|
||||
Reference in New Issue
Block a user