From 2d74388a767ef30012218c00ce3aa50ef46b0ef5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 3 Aug 2014 00:30:08 +0200 Subject: [PATCH] Don't report crime if we are in combat with the victim --- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index 199dc488d6..14298c97d4 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -973,6 +973,9 @@ namespace MWMechanics if (!it->getClass().isNpc()) continue; + if (it->getClass().getCreatureStats(*it).getAiSequence().isInCombat(victim)) + continue; + // Will the witness report the crime? if (it->getClass().getCreatureStats(*it).getAiSetting(CreatureStats::AI_Alarm).getBase() >= alarm) { @@ -1071,6 +1074,9 @@ namespace MWMechanics if (*it != victim && type == OT_Assault) aggression = iFightAttacking; + if (it->getClass().getCreatureStats(*it).getAiSequence().isInCombat(victim)) + continue; + if (it->getClass().isClass(*it, "guard")) { // Mark as Alarmed for dialogue