Fix for bot combat line-of-sight issue (let me know if this causes zone training again)

This commit is contained in:
Uleat 2017-02-24 10:02:50 -05:00
parent 3383f65ff7
commit 171474f1d2

View File

@ -2217,7 +2217,7 @@ void Bot::AI_Process() {
// Let's check if we have a los with our target. // Let's check if we have a los with our target.
// If we don't, our hate_list is wiped. // If we don't, our hate_list is wiped.
// Else, it was causing the bot to aggro behind wall etc... causing massive trains. // Else, it was causing the bot to aggro behind wall etc... causing massive trains.
if(!CheckLosFN(GetTarget()) || GetTarget()->IsMezzed() || !IsAttackAllowed(GetTarget())) { if(GetTarget()->IsMezzed() || !IsAttackAllowed(GetTarget())) {
WipeHateList(); WipeHateList();
if(IsMoving()) { if(IsMoving()) {
SetHeading(0); SetHeading(0);
@ -2228,6 +2228,16 @@ void Bot::AI_Process() {
} }
return; return;
} }
else if (!CheckLosFN(GetTarget())) {
if (!IsRooted()) {
Mob* follow = entity_list.GetMob(GetFollowID());
if (follow)
CalculateNewPosition2(follow->GetX(), follow->GetY(), follow->GetZ(), GetRunspeed());
return;
}
return;
}
if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive))) if (!(m_PlayerState & static_cast<uint32>(PlayerState::Aggressive)))
SendAddPlayerState(PlayerState::Aggressive); SendAddPlayerState(PlayerState::Aggressive);