Don't add additional targets to allies that are already in combat

just_say_no_to_geode
Evil Eye 3 years ago
parent ede09309a6
commit cc081c3d2d

@ -11,6 +11,7 @@
Bug #3792: 1 frame late magicka recalc breaks early scripted magicka reactions to Intelligence change
Bug #3846: Strings starting with "-" fail to compile if not enclosed in quotes
Bug #3855: AI sometimes spams defensive spells
Bug #3867: All followers attack player when one follower enters combat with player
Bug #3905: Great House Dagoth issues
Bug #4203: Resurrecting an actor doesn't close the loot GUI
Bug #4376: Moved actors don't respawn in their original cells
@ -26,6 +27,7 @@
Bug #5192: Actor turn rate is too slow
Bug #5207: Loose summons can be present in scene
Bug #5279: Ingame console stops auto-scrolling after clicking output
Bug #5318: Aiescort behaves differently from vanilla
Bug #5371: 'Dead' slaughterfish added by mod are animated/alive
Bug #5377: Console does not appear after using menutest in inventory
Bug #5379: Wandering NPCs falling through cantons

@ -501,6 +501,9 @@ namespace MWMechanics
// If an ally of actor1 has been attacked by actor2 or has attacked actor2, start combat between actor1 and actor2
for (const MWWorld::Ptr& ally : allies1)
{
// Don't let allies that are already in combat choose additional sides
if (ally.getClass().getCreatureStats(ally).getAiSequence().isInCombat())
continue;
if (creatureStats1.getAiSequence().isInCombat(ally))
continue;

@ -1457,7 +1457,14 @@ namespace MWMechanics
}
if (!peaceful)
{
startCombat(target, attacker);
// Force friendly actors into combat to prevent infighting between followers
std::set<MWWorld::Ptr> followersTarget;
getActorsSidingWith(target, followersTarget);
for(const auto& follower : followersTarget)
startCombat(follower, attacker);
}
}
}

Loading…
Cancel
Save