mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Fix: Bots not mounting in BG's anymore (#1056)
Bots didn't stop as they were supposed to, leading to some issues.
This commit is contained in:
parent
13a4dde643
commit
bf22f20997
@ -144,8 +144,9 @@ bool CheckMountStateAction::Execute(Event /*event*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
// If there is a master and bot not in BG
|
||||
bool inBattleground = bot->InBattleground();
|
||||
|
||||
// If there is a master and bot not in BG
|
||||
if (master && !inBattleground)
|
||||
{
|
||||
Group* group = bot->GetGroup();
|
||||
@ -305,9 +306,6 @@ bool CheckMountStateAction::TryPreferredMount(Player* master) const
|
||||
if (index < mounts.size() && sSpellMgr->GetSpellInfo(mounts[index]) &&
|
||||
botAI->CanCastSpell(mounts[index], bot))
|
||||
{
|
||||
if (bot->isMoving())
|
||||
bot->StopMoving();
|
||||
|
||||
botAI->CastSpell(mounts[index], bot);
|
||||
return true;
|
||||
}
|
||||
@ -319,6 +317,10 @@ bool CheckMountStateAction::TryPreferredMount(Player* master) const
|
||||
|
||||
bool CheckMountStateAction::TryRandomMountFiltered(const std::map<int32, std::vector<uint32>>& spells, int32 masterSpeed) const
|
||||
{
|
||||
// Required here as otherwise bots won't mount in BG's due to them constant moving
|
||||
if (bot->isMoving())
|
||||
bot->StopMoving();
|
||||
|
||||
for (const auto& pair : spells)
|
||||
{
|
||||
int32 currentSpeed = pair.first;
|
||||
@ -333,9 +335,6 @@ bool CheckMountStateAction::TryRandomMountFiltered(const std::map<int32, std::ve
|
||||
|
||||
if (botAI->CanCastSpell(ids[index], bot))
|
||||
{
|
||||
if (bot->isMoving())
|
||||
bot->StopMoving();
|
||||
|
||||
botAI->CastSpell(ids[index], bot);
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user