BG: Crash fix when bots are trying to determine the eye flagcarrier when the battleground no longer exists (#1119)

This commit is contained in:
EricksOliveira 2025-03-25 09:27:13 -03:00 committed by GitHub
parent 08b77acd8d
commit 105b16358f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,6 +44,9 @@ Unit* FlagCarrierValue::Calculate()
{ {
BattlegroundEY* bg = (BattlegroundEY*)botAI->GetBot()->GetBattleground(); BattlegroundEY* bg = (BattlegroundEY*)botAI->GetBot()->GetBattleground();
if (!bg)
return nullptr;
if (bg->GetFlagPickerGUID().IsEmpty()) if (bg->GetFlagPickerGUID().IsEmpty())
return nullptr; return nullptr;