From 11605bd19a971ffdbfd0b23700b9c0e8111d553c Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 25 Apr 2017 16:08:14 +0300 Subject: [PATCH] [Client] Make aggressive actors initiate combat with DedicatedPlayers Previously, they were only attacking DedicatedPlayers who had attacked them first. --- apps/openmw/mwmechanics/actors.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 156c02a9b..e092dc8fc 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -406,6 +406,18 @@ namespace MWMechanics if (std::find(playerAllies.begin(), playerAllies.end(), actor1) == playerAllies.end()) aggressive = MWBase::Environment::get().getMechanicsManager()->isAggressive(actor1, actor2); } + /* + Start of tes3mp addition + + Make aggressive actors initiate combat with DedicatedPlayers + */ + else if (mwmp::PlayerList::isDedicatedPlayer(actor2)) + { + aggressive = MWBase::Environment::get().getMechanicsManager()->isAggressive(actor1, actor2); + } + /* + End of tes3mp addition + */ } // Make guards go aggressive with creatures that are in combat, unless the creature is a follower or escorter @@ -882,7 +894,7 @@ namespace MWMechanics /* Start of tes3mp change (major) - We need player-controlled NPCs to not automatically unequip + We need DedicatedPlayers to not automatically unequip their light-emitting items, so a 2nd condition has been added for them */