mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-05 06:40:09 +00:00
Merge remote-tracking branch 'scrawl/master'
This commit is contained in:
commit
e0781a5d70
@ -184,6 +184,11 @@ void AiSequence::execute (const MWWorld::Ptr& actor, CharacterController& charac
|
|||||||
const ESM::Position &targetPos = target.getRefData().getPosition();
|
const ESM::Position &targetPos = target.getRefData().getPosition();
|
||||||
|
|
||||||
float distTo = (targetPos.asVec3() - vActorPos).length();
|
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)
|
if (distTo < nearestDist)
|
||||||
{
|
{
|
||||||
nearestDist = distTo;
|
nearestDist = distTo;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user