Skip to content

Commit 9f1477d

Browse files
committed
improve target facing
stricter check for moving use SET_FACING opcode to update facing for others is supposed to fix hunters teleporting around when keeping distance
1 parent d897d6c commit 9f1477d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

playerbot/PlayerbotAI.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ void PlayerbotAI::UpdateFaceTarget(uint32 elapsed, bool minimal)
602602
if (IsStateActive(BotState::BOT_STATE_COMBAT))
603603
{
604604
// Don't update facing if bot is moving
605-
if (bot->IsStopped())
605+
if (!sServerFacade.isMoving(bot) && !bot->isMovingOrTurning())
606606
{
607607
AiObjectContext* context = GetAiObjectContext();
608608
Unit* target = AI_VALUE(Unit*, "current target");
@@ -626,6 +626,11 @@ void PlayerbotAI::UpdateFaceTarget(uint32 elapsed, bool minimal)
626626
!bot->hasUnitState(UNIT_STAT_CAN_NOT_REACT_OR_LOST_CONTROL))
627627
{
628628
sServerFacade.SetFacingTo(bot, target);
629+
bot->SetInFront(target);
630+
WorldPacket data(MSG_MOVE_SET_FACING);
631+
data << bot->GetPackGUID();
632+
data << bot->m_movementInfo;
633+
bot->GetMover()->SendMessageToSetExcept(data, bot);
629634
}
630635
}
631636
}

0 commit comments

Comments
 (0)