From c65d6c1328db57e80c909af2937fd27182c54ea0 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 27 Oct 2018 02:19:45 +0300 Subject: [PATCH] [Client] Disable mListener methods in mwworld/containerstore This should put an end to frequent crashes until I can fix the problem properly. --- apps/openmw/mwworld/containerstore.cpp | 28 ++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp index 79ba30130..2d52f44a9 100644 --- a/apps/openmw/mwworld/containerstore.cpp +++ b/apps/openmw/mwworld/containerstore.cpp @@ -366,8 +366,18 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr item.getRefData().getLocals().setVarByInt(script, "onpcadd", 1); } - if (mListener) - mListener->itemAdded(item, count); + /* + Start of tes3mp change (major) + + Disable the listener here because it keeps causing crashes; this should only be + a temporary solution that doesn't affect much anyway given that the listener is + only used in relation to light-emitting items + */ + //if (mListener) + // mListener->itemAdded(item, count); + /* + End of tes3mp change (major) + */ return it; } @@ -493,8 +503,18 @@ int MWWorld::ContainerStore::remove(const Ptr& item, int count, const Ptr& actor flagAsModified(); - if (mListener) - mListener->itemRemoved(item, count - toRemove); + /* + Start of tes3mp change (major) + + Disable the listener here because it keeps causing crashes; this should only be + a temporary solution that doesn't affect much anyway given that the listener is + only used in relation to light-emitting items + */ + //if (mListener) + // mListener->itemRemoved(item, count - toRemove); + /* + End of tes3mp change (major) + */ // number of removed items return count - toRemove;