1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 13:09:40 +00:00

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

This commit is contained in:
Dobrohotov Alexei 2021-03-03 22:04:10 +03:00
parent 54a7048eed
commit fc329050b3
2 changed files with 8 additions and 2 deletions

View file

@ -103,6 +103,7 @@
Bug #5838: Local map and other menus become blank in some locations while playing Wizards' Islands mod. 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 #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 #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 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 #390: 3rd person look "over the shoulder"
Feature #1536: Show more information about level on menu Feature #1536: Show more information about level on menu

View file

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