1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 13:45:34 +00:00

Make search for allies in actorAttacked recursive

This commit is contained in:
Capostrophic 2018-08-14 15:41:34 +03:00
parent 7029ed0e8d
commit 75bd6e1d28

View file

@ -1,6 +1,7 @@
#include "mechanicsmanagerimp.hpp"
#include <limits.h>
#include <set>
#include <components/misc/rng.hpp>
@ -1445,11 +1446,12 @@ namespace MWMechanics
if (target == getPlayer() || !attacker.getClass().isActor())
return false;
std::list<MWWorld::Ptr> followersAttacker = getActorsSidingWith(attacker);
std::set<MWWorld::Ptr> followersAttacker;
getActorsSidingWith(attacker, followersAttacker);
MWMechanics::CreatureStats& statsTarget = target.getClass().getCreatureStats(target);
if (std::find(followersAttacker.begin(), followersAttacker.end(), target) != followersAttacker.end())
if (followersAttacker.find(target) != followersAttacker.end())
{
statsTarget.friendlyHit();