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:
parent
7029ed0e8d
commit
75bd6e1d28
1 changed files with 4 additions and 2 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue