mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01: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:
parent
d9da6d942d
commit
8f92fbade3
@ -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));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user