From 62c04c675882e801b1835dfc4bbaff53b2c01ba0 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 9 Mar 2018 21:49:27 +0400 Subject: [PATCH] Unstack soulgem, added via AddSoulGem console command (bug #4351) --- apps/openmw/mwscript/miscextensions.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index 1067b5536..59f2cc9c6 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -454,7 +454,13 @@ namespace MWScript store.get().find(creature); // This line throws an exception if it can't find the creature MWWorld::Ptr item = *ptr.getClass().getContainerStore(ptr).add(gem, 1, ptr); + + // Set the soul on just one of the gems, not the whole stack + item.getContainerStore()->unstack(item, ptr); item.getCellRef().setSoul(creature); + + // Restack the gem with other gems with the same soul + item.getContainerStore()->restack(item); } };