mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Implement vanilla distance threshold for AI processing (Bug #1876)
This commit is contained in:
parent
f18d4b4ac4
commit
d2ef0d362c
@ -1117,7 +1117,11 @@ namespace MWMechanics
|
||||
{
|
||||
updateActor(iter->first, duration);
|
||||
|
||||
if (MWBase::Environment::get().getMechanicsManager()->isAIActive())
|
||||
// AI processing is only done within distance of 7168 units to the player. Note the "AI distance" slider doesn't affect this
|
||||
// (it only does some throttling for targets beyond the "AI distance", so doesn't give any guarantees as to whether AI will be enabled or not)
|
||||
if (MWBase::Environment::get().getMechanicsManager()->isAIActive() &&
|
||||
Ogre::Vector3(player.getRefData().getPosition().pos).squaredDistance(Ogre::Vector3(iter->first.getRefData().getPosition().pos))
|
||||
<= 7168*7168)
|
||||
{
|
||||
if (timerUpdateAITargets == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user