From 6bb030aa55fd5df9bbc73e1d1c3516346a56bcf8 Mon Sep 17 00:00:00 2001 From: NeveHanter Date: Sat, 3 Jul 2021 13:40:36 +0200 Subject: [PATCH] Ignore actors siding with player in awarness check to allow training the sneaking or knowing whether player is detected by other actors in the siding actor line of sight --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/actors.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bcf27301a..b508d518d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Bug #6066: addtopic "return" does not work from within script. No errors thrown Bug #6101: Disarming trapped unlocked owned objects isn't considered a crime Bug #6115: Showmap overzealous matching + Bug #6133: Cannot reliably sneak or steal in the sight of the NPCs siding with player 0.47.0 ------ diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index e62d686ee2..43d0264764 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -2396,11 +2396,17 @@ namespace MWMechanics float radius = std::min(fSneakUseDist, mActorsProcessingRange); getObjectsInRange(position, radius, observers); + std::set sidingActors; + getActorsSidingWith(player, sidingActors); + for (const MWWorld::Ptr &observer : observers) { if (observer == player || observer.getClass().getCreatureStats(observer).isDead()) continue; + if (sidingActors.find(observer) != sidingActors.cend()) + continue; + if (world->getLOS(player, observer)) { if (MWBase::Environment::get().getMechanicsManager()->awarenessCheck(player, observer))