Add possible crash fix when summoning an invalid bot (#1125)

This commit is contained in:
EricksOliveira
2025-03-28 12:08:40 -03:00
committed by GitHub
parent d2204d41e2
commit 495269bfa0

View File

@@ -217,6 +217,9 @@ bool SummonAction::Teleport(Player* summoner, Player* player)
if (bot->isDead() && revive) if (bot->isDead() && revive)
{ {
if (!botAI->IsSafe(player) || !botAI->IsSafe(summoner))
return false;
bot->ResurrectPlayer(1.0f, false); bot->ResurrectPlayer(1.0f, false);
botAI->TellMasterNoFacing("I live, again!"); botAI->TellMasterNoFacing("I live, again!");
botAI->GetAiObjectContext()->GetValue<GuidVector>("prioritized targets")->Reset(); botAI->GetAiObjectContext()->GetValue<GuidVector>("prioritized targets")->Reset();