From 372697489bf3af4c636c59c6f6654fb6424c033e Mon Sep 17 00:00:00 2001 From: Capostrophic <21265616+Capostrophic@users.noreply.github.com> Date: Fri, 17 Aug 2018 02:41:06 +0300 Subject: [PATCH 1/2] Fix Equip command infinite loop (bug #3072) --- CHANGELOG.md | 1 + apps/openmw/mwgui/inventorywindow.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8eef0d45ef..7fb19f2763f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Bug #2872: Tab completion in console doesn't work with explicit reference Bug #2971: Compiler did not reject lines with naked expressions beginning with x.y Bug #3049: Drain and Fortify effects are not properly applied on health, magicka and fatigue + Bug #3072: Fatal error on AddItem that has a script containing Equip Bug #3249: Fixed revert function not updating views properly Bug #3374: Touch spells not hitting kwama foragers Bug #3486: [Mod] NPC Commands does not work diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index ce6d0d522c3..0b35bd9de4d 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -517,7 +517,7 @@ namespace MWGui // Give the script a chance to run once before we do anything else // this is important when setting pcskipequip as a reaction to onpcequip being set (bk_treasuryreport does this) - if (!script.empty() && MWBase::Environment::get().getWorld()->getScriptsEnabled()) + if (!force && !script.empty() && MWBase::Environment::get().getWorld()->getScriptsEnabled()) { MWScript::InterpreterContext interpreterContext (&ptr.getRefData().getLocals(), ptr); MWBase::Environment::get().getScriptManager()->run (script, interpreterContext); From ce78a34010f129720c44d04263b36088b8d5a7f1 Mon Sep 17 00:00:00 2001 From: Capostrophic <21265616+Capostrophic@users.noreply.github.com> Date: Fri, 17 Aug 2018 03:32:33 +0300 Subject: [PATCH 2/2] Use container ID in Equip command warning --- apps/openmw/mwscript/containerextensions.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwscript/containerextensions.cpp b/apps/openmw/mwscript/containerextensions.cpp index dd3e54a88ad..cf12d12c3a4 100644 --- a/apps/openmw/mwscript/containerextensions.cpp +++ b/apps/openmw/mwscript/containerextensions.cpp @@ -192,8 +192,9 @@ namespace MWScript if (it == invStore.end()) { it = ptr.getClass().getContainerStore (ptr).add (item, 1, ptr); - Log(Debug::Warning) << "Implicitly adding one " << item << " to container " - "to fulfil requirements of Equip instruction"; + Log(Debug::Warning) << "Implicitly adding one " << item << + " to the inventory store of " << ptr.getCellRef().getRefId() << + " to fulfill the requirements of Equip instruction"; } if (ptr == MWMechanics::getPlayer())