fix (#1179): resolve bot stuttering in BGs after player death (#1269)

Fixes #1179

This update fixes several issues related to bot behavior in battlegrounds when the player dies and releases spirit:

- Removed conflicting strategies (+stay / +follow): Bots were being told to follow and stay simultaneously each tick, causing oscillating movement ("stuttering"). The +stay strategy is now skipped in BGs to allow bots to continue objectives normally.

- Disabled follow while in BG: When the player died, bots attempted to return to the player repeatedly, abandoning objective-based movement. PlayerbotAI now sets -follow while in BGs to keep bots engaged with the objectives.

- Prevented dead bots from following ghosts: Previously, dead bots would follow ghost players away from the graveyard and potentially miss Rez. Bots now wait at the spirit healer when dead in BGs.

- Removed redundant strategy changes and messages in ReleaseSpiritAction as they no longer apply in battleground contexts.
This commit is contained in:
Type1Error
2025-05-06 19:09:32 +00:00
committed by GitHub
parent 0d170f5370
commit e48c3351d3
3 changed files with 25 additions and 6 deletions

View File

@@ -1423,12 +1423,21 @@ void PlayerbotAI::DoNextAction(bool min)
master = newMaster;
botAI->SetMaster(newMaster);
botAI->ResetStrategies();
botAI->ChangeStrategy("+follow", BOT_STATE_NON_COMBAT);
if (!bot->InBattleground())
{
botAI->ChangeStrategy("+follow", BOT_STATE_NON_COMBAT);
if (botAI->GetMaster() == botAI->GetGroupMaster())
botAI->TellMaster("Hello, I follow you!");
if (botAI->GetMaster() == botAI->GetGroupMaster())
botAI->TellMaster("Hello, I follow you!");
else
botAI->TellMaster(!urand(0, 2) ? "Hello!" : "Hi!");
}
else
botAI->TellMaster(!urand(0, 2) ? "Hello!" : "Hi!");
{
// we're in a battleground, stay with the pack and focus on objective
botAI->ChangeStrategy("-follow", BOT_STATE_NON_COMBAT);
}
}
}