mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-15 22:13:15 +00:00
Merge branch 'i-could-be-further-away' into 'master'
CLEANUP: Always use squared distance in types.Actor.isInActorsProcessingRange See merge request OpenMW/openmw!4945
This commit is contained in:
commit
85e35cbf58
1 changed files with 2 additions and 2 deletions
|
|
@ -396,8 +396,8 @@ namespace MWLua
|
|||
const int actorsProcessingRange = Settings::game().mActorsProcessingRange;
|
||||
const osg::Vec3f playerPos = player.getRefData().getPosition().asVec3();
|
||||
|
||||
const float dist = (playerPos - target.getRefData().getPosition().asVec3()).length();
|
||||
return dist <= actorsProcessingRange;
|
||||
const float dist = (playerPos - target.getRefData().getPosition().asVec3()).length2();
|
||||
return dist <= (actorsProcessingRange * actorsProcessingRange);
|
||||
};
|
||||
|
||||
actor["isDead"] = [](const Object& o) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue