Fix crash when RandomBotSayWithoutMaster set to 1

This commit is contained in:
郑佩茹
2023-03-16 11:18:23 -06:00
parent d8ac42439a
commit 7c872915ec

View File

@@ -1479,7 +1479,7 @@ bool PlayerbotAI::TellMaster(std::ostringstream& stream, PlayerbotSecurityLevel
bool PlayerbotAI::TellMaster(std::string const text, PlayerbotSecurityLevel securityLevel)
{
if (!TellMasterNoFacing(text, securityLevel))
if (!master || !TellMasterNoFacing(text, securityLevel))
return false;
if (!bot->isMoving() && !bot->IsInCombat() && bot->GetMapId() == master->GetMapId() && !bot->HasUnitState(UNIT_STATE_IN_FLIGHT) && !bot->IsFlying())