1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-17 10:21:11 +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 <typeinfo>
#include <iostream> #include <iostream>
#include <components/esm/esmreader.hpp> #include <components/esm/esmreader.hpp>
#include <components/esm/esmwriter.hpp> #include <components/esm/esmwriter.hpp>
#include <components/esm/loadnpc.hpp> #include <components/esm/loadnpc.hpp>
@ -1927,7 +1926,8 @@ namespace MWMechanics
osg::Vec3f position (actor.getRefData().getPosition().asVec3()); osg::Vec3f position (actor.getRefData().getPosition().asVec3());
getObjectsInRange(position, aiProcessingDistance, neighbors); 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) for(auto neighbor = neighbors.begin(); neighbor != neighbors.end(); ++neighbor)
{ {
const CreatureStats &stats = neighbor->getClass().getCreatureStats(*neighbor); const CreatureStats &stats = neighbor->getClass().getCreatureStats(*neighbor);