PlayerbotAI fix:
If the player is unmounted, when add a mounted bot, the bot will not change it's mounted status.
If the player and bots are mounted, and the bots is under attacked, the bot will stoped following the player.
diff --git a/src/game/playerbot/PlayerbotAI.cpp b/src/game/playerbot/PlayerbotAI.cpp
index 12d9dbb..40c45b3 100644
--- a/src/game/playerbot/PlayerbotAI.cpp
+++ b/src/game/playerbot/PlayerbotAI.cpp
@@ -2827,14 +2827,25 @@ void PlayerbotAI::UpdateAI(const uint32 p_time)
m_spellIdCommand = 0;
m_targetGuidCommand = 0;
}
+
+ //if master is unmounted, unmount the bot
+ else if (!GetMaster()->IsMounted() && m_bot->IsMounted())
+ {
+ WorldPacket emptyPacket;
+ m_bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket); //updated code
+ }
// handle combat (either self/master/group in combat, or combat state and valid target)
else if (IsInCombat() || (m_botState == BOTSTATE_COMBAT && m_targetCombat))
- {
- if (!pSpell || !pSpell->IsChannelActive())
- DoNextCombatManeuver();
- else
- SetIgnoreUpdateTime(1); // It's better to update AI more frequently during combat
+ {
+ //check if the bot is Mounted
+ if (!m_bot->IsMounted())
+ {
+ if (!pSpell || !pSpell->IsChannelActive())
+ DoNextCombatManeuver();
+ else
+ SetIgnoreUpdateTime(1); // It's better to update AI more frequently during combat
+ }
}
// bot was in combat recently - loot now
else if (m_botState == BOTSTATE_COMBAT)