fix bg bot part 1
This commit is contained in:
@@ -382,8 +382,16 @@ void BattlegroundAI::FallbackBehavior(::Player* player)
|
||||
// Try to find a nearby enemy player
|
||||
if (Player* enemy = player->SelectNearestPlayer(30.0f))
|
||||
{
|
||||
player->AI()->AttackStart(enemy);
|
||||
return;
|
||||
// Additional safety checks
|
||||
if (enemy->IsInWorld() && enemy->IsAlive() && !enemy->IsGameMaster() &&
|
||||
player->IsHostileTo(enemy) && player->IsValidAttackTarget(enemy))
|
||||
{
|
||||
if (player->AI())
|
||||
{
|
||||
player->AI()->AttackStart(enemy);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// No enemies nearby - just wander a bit to avoid looking frozen
|
||||
|
||||
Reference in New Issue
Block a user