mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 17:39:42 +00:00
fix possible bug in aipursue
This commit is contained in:
parent
f34223fce9
commit
f98a821482
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,7 @@ bool AiPursue::execute (const MWWorld::Ptr& actor, CharacterController& characte
|
||||||
float pathTolerance = 100.0;
|
float pathTolerance = 100.0;
|
||||||
|
|
||||||
if (pathTo(actor, dest, duration, pathTolerance) &&
|
if (pathTo(actor, dest, duration, pathTolerance) &&
|
||||||
MWMechanics::distance(dest,aPos.pos[0],aPos.pos[1],aPos.pos[2]) < pathTolerance) // check the true distance in case the target is far away in Z-direction
|
abs(dest.mZ - aPos.pos[2]) < pathTolerance) // check the true distance in case the target is far away in Z-direction
|
||||||
{
|
{
|
||||||
target.getClass().activate(target,actor).get()->execute(actor); //Arrest player when reached
|
target.getClass().activate(target,actor).get()->execute(actor); //Arrest player when reached
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue