1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 08:15:54 +00:00

Make search for followers in getEnemiesNearby recursive

This commit is contained in:
Capostrophic 2018-08-14 16:14:48 +03:00
parent 75bd6e1d28
commit 53599290c3

View file

@ -2,7 +2,6 @@
#include <typeinfo>
#include <iostream>
#include <components/esm/esmreader.hpp>
#include <components/esm/esmwriter.hpp>
#include <components/esm/loadnpc.hpp>
@ -1927,7 +1926,8 @@ namespace MWMechanics
osg::Vec3f position (actor.getRefData().getPosition().asVec3());
getObjectsInRange(position, aiProcessingDistance, neighbors);
std::list<MWWorld::Ptr> followers = getActorsFollowing(actor);
std::set<MWWorld::Ptr> followers;
getActorsFollowing(actor, followers);
for(auto neighbor = neighbors.begin(); neighbor != neighbors.end(); ++neighbor)
{
const CreatureStats &stats = neighbor->getClass().getCreatureStats(*neighbor);