AIPursue: Pursue the player until LOS is established (#5869)

cherry-pick-d595c7ad
Dobrohotov Alexei 3 years ago
parent 54a7048eed
commit fc329050b3

@ -103,6 +103,7 @@
Bug #5838: Local map and other menus become blank in some locations while playing Wizards' Islands mod.
Bug #5840: GetSoundPlaying "Health Damage" doesn't play when NPC hits target with shield effect ( vanilla engine behavior )
Bug #5841: Can't Cast Zero Cost Spells When Magicka is < 0
Bug #5869: Guards can initiate arrest dialogue behind locked doors
Bug #5871: The console appears if you type the Russian letter "Ё" in the name of the enchantment
Feature #390: 3rd person look "over the shoulder"
Feature #1536: Show more information about level on menu

@ -53,9 +53,14 @@ bool AiPursue::execute (const MWWorld::Ptr& actor, CharacterController& characte
const float pathTolerance = 100.f;
if (pathTo(actor, dest, duration, pathTolerance) &&
std::abs(dest.z() - actorPos.z()) < pathTolerance) // check the true distance in case the target is far away in Z-direction
// check the true distance in case the target is far away in Z-direction
bool reached = pathTo(actor, dest, duration, pathTolerance) &&
std::abs(dest.z() - actorPos.z()) < pathTolerance;
if (reached)
{
if (!MWBase::Environment::get().getWorld()->getLOS(target, actor))
return false;
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Dialogue, actor); //Arrest player when reached
return true;
}

Loading…
Cancel
Save