mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 09:07:19 +00:00
[BUG FIX] Movement flag update called for bots while rooted (#1991)
Fix for the error "Attempted sending heartbeat with root flag for guid" The core does not allow movement flag updates when unit/player has the MOVEMENTFLAG_ROOT flag. Change scope bots alone.
This commit is contained in:
@@ -1426,8 +1426,8 @@ void PlayerbotAI::DoNextAction(bool min)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change engine if just ressed
|
// Change engine if just ressed (no movement update when rooted)
|
||||||
if (currentEngine == engines[BOT_STATE_DEAD] && isBotAlive)
|
if (currentEngine == engines[BOT_STATE_DEAD] && isBotAlive && !bot->IsRooted())
|
||||||
{
|
{
|
||||||
bot->SendMovementFlagUpdate();
|
bot->SendMovementFlagUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -1654,6 +1654,10 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot, std::vector<WorldLocation>&
|
|||||||
if (bot->IsBeingTeleported() || !bot->IsInWorld())
|
if (bot->IsBeingTeleported() || !bot->IsInWorld())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// no teleport / movement update when rooted.
|
||||||
|
if (bot->IsRooted())
|
||||||
|
return;
|
||||||
|
|
||||||
// ignore when in queue for battle grounds.
|
// ignore when in queue for battle grounds.
|
||||||
if (bot->InBattlegroundQueue())
|
if (bot->InBattlegroundQueue())
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -41,12 +41,16 @@ bool ServerFacade::IsDistanceLessOrEqualThan(float dist1, float dist2) { return
|
|||||||
|
|
||||||
void ServerFacade::SetFacingTo(Player* bot, WorldObject* wo, bool force)
|
void ServerFacade::SetFacingTo(Player* bot, WorldObject* wo, bool force)
|
||||||
{
|
{
|
||||||
|
if (!bot)
|
||||||
|
return;
|
||||||
|
|
||||||
float angle = bot->GetAngle(wo);
|
float angle = bot->GetAngle(wo);
|
||||||
// if (!force && bot->isMoving())
|
// if (!force && bot->isMoving())
|
||||||
// bot->SetFacingTo(bot->GetAngle(wo));
|
// bot->SetFacingTo(bot->GetAngle(wo));
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
bot->SetOrientation(angle);
|
bot->SetOrientation(angle);
|
||||||
|
if (!bot->IsRooted())
|
||||||
bot->SendMovementFlagUpdate();
|
bot->SendMovementFlagUpdate();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -417,6 +417,7 @@ bool FishingAction::Execute(Event event)
|
|||||||
{
|
{
|
||||||
float angle = bot->GetAngle(pos.GetPositionX(), pos.GetPositionY());
|
float angle = bot->GetAngle(pos.GetPositionX(), pos.GetPositionY());
|
||||||
bot->SetOrientation(angle);
|
bot->SetOrientation(angle);
|
||||||
|
if (!bot->IsRooted())
|
||||||
bot->SendMovementFlagUpdate();
|
bot->SendMovementFlagUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user