From 799241e8c6b16dfa8e15d39baafd5f162006f68d Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 11 Jan 2019 08:16:29 +0200 Subject: [PATCH] [Client] Use informative error message for RefData::setCount() issue --- apps/openmw/mwworld/inventorystore.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index cb9d6d350..ac8ee6ac8 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -13,6 +13,7 @@ Include additional headers for multiplayer purposes */ +#include #include "../mwmp/Main.hpp" #include "../mwmp/CellController.hpp" #include "../mwmp/PlayerList.hpp" @@ -251,7 +252,19 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::findSlot (int slot) con { // Object has been deleted // This should no longer happen, since the new remove function will unequip first - throw std::runtime_error("Invalid slot, make sure you are not calling RefData::setCount for a container object"); + + /* + Start of tes3mp change (major) + + Instead of throwing an error, display an error log message with information about + the item + */ + //throw std::runtime_error("Invalid slot, make sure you are not calling RefData::setCount for a container object"); + LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Invalid slot, make sure you are not calling RefData::setCount for a container object\n- item was %s", + mSlots[slot]->getCellRef().getRefId().c_str()); + /* + End of tes3mp change (major) + */ } return mSlots[slot];