From 92bdd44e58941e2e681fde4f590416db6ce239e1 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sun, 31 Oct 2021 20:25:37 +0100 Subject: [PATCH] Allow creatures to use torches --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/actors.cpp | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09a574338a..11e4e0ae26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ Bug #6326: Detect Enchantment/Key should detect items in unresolved containers Bug #6347: PlaceItem/PlaceItemCell/PlaceAt should work with levelled creatures Bug #6363: Some scripts in Morrowland fail to work + Bug #6376: Creatures should be able to use torches Feature #890: OpenMW-CS: Column filtering Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record Feature #2780: A way to see current OpenMW version in the console diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 0af65844f9..cb4f8237e7 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1496,15 +1496,13 @@ namespace MWMechanics stats.getAiSequence().execute(iter->first, *ctrl, duration, /*outOfRange*/true); } - if(iter->first.getClass().isNpc()) + if(inProcessingRange && iter->first.getClass().isNpc()) { // We can not update drowning state for actors outside of AI distance - they can not resurface to breathe - if (inProcessingRange) - updateDrowning(iter->first, duration, ctrl->isKnockedOut(), isPlayer); - - if (timerUpdateEquippedLight == 0) - updateEquippedLight(iter->first, updateEquippedLightInterval, showTorches); + updateDrowning(iter->first, duration, ctrl->isKnockedOut(), isPlayer); } + if(timerUpdateEquippedLight == 0 && iter->first.getClass().hasInventoryStore(iter->first)) + updateEquippedLight(iter->first, updateEquippedLightInterval, showTorches); if (luaControls && isConscious(iter->first)) {