Skip to content

Commit

Permalink
Merge remote-tracking branch 'scrawl/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
zinnschlag committed Jul 5, 2015
2 parents 6c5dc5c + 531bca1 commit e0781a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/openmw/mwmechanics/aisequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ void AiSequence::execute (const MWWorld::Ptr& actor, CharacterController& charac
const ESM::Position &targetPos = target.getRefData().getPosition();

float distTo = (targetPos.asVec3() - vActorPos).length();

// Small threshold for changing target
if (it == mPackages.begin())
distTo = std::max(0.f, distTo - 50.f);

if (distTo < nearestDist)
{
nearestDist = distTo;
Expand Down

0 comments on commit e0781a5

Please sign in to comment.