From 879e66a0439aa27a4d2af4341028334d4792bdfc Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sat, 13 Feb 2021 20:55:24 +0100 Subject: [PATCH] Don't autoequip items when implicitely adding an item using equip --- apps/openmw/mwscript/containerextensions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwscript/containerextensions.cpp b/apps/openmw/mwscript/containerextensions.cpp index 375242f17c..7eeb3bfaba 100644 --- a/apps/openmw/mwscript/containerextensions.cpp +++ b/apps/openmw/mwscript/containerextensions.cpp @@ -308,7 +308,8 @@ namespace MWScript } if (it == invStore.end()) { - it = ptr.getClass().getContainerStore (ptr).add (item, 1, ptr); + MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), item, 1); + it = ptr.getClass().getContainerStore (ptr).add (ref.getPtr(), 1, ptr, false); Log(Debug::Warning) << "Implicitly adding one " << item << " to the inventory store of " << ptr.getCellRef().getRefId() << " to fulfill the requirements of Equip instruction";