diff --git a/apps/openmw/mwgui/inventoryitemmodel.cpp b/apps/openmw/mwgui/inventoryitemmodel.cpp index 712e1b6c6..672ea9c16 100644 --- a/apps/openmw/mwgui/inventoryitemmodel.cpp +++ b/apps/openmw/mwgui/inventoryitemmodel.cpp @@ -56,7 +56,7 @@ void InventoryItemModel::removeItem (const ItemStack& item, size_t count) if (removed == 0) throw std::runtime_error("Item to remove not found in container store"); - else if (removed < count) + else if (removed < static_cast(count)) throw std::runtime_error("Not enough items in the stack to remove"); } diff --git a/apps/openmw/mwworld/containerstore.hpp b/apps/openmw/mwworld/containerstore.hpp index 2cdefd2f4..7278135d8 100644 --- a/apps/openmw/mwworld/containerstore.hpp +++ b/apps/openmw/mwworld/containerstore.hpp @@ -93,7 +93,6 @@ namespace MWWorld virtual bool stacks (const Ptr& stack, const Ptr& item); ///< @return true if the two specified objects can stack with each other - /// @note stack is the item that is already in this container void fill (const ESM::InventoryList& items, const std::string& owner, const MWWorld::ESMStore& store); ///< Insert items into *this. diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index dc2d0cab1..430218058 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -295,7 +295,7 @@ bool MWWorld::InventoryStore::stacks(const Ptr& stack, const Ptr& item) for (TSlots::const_iterator iter (mSlots.begin()); iter!=mSlots.end(); ++iter) { - if (*iter != end() && stack == **iter) + if (*iter != end() && (stack == **iter || item == **iter)) { bool stackWhenEquipped = MWWorld::Class::get(**iter).getEquipmentSlots(**iter).second; if (!stackWhenEquipped) diff --git a/apps/openmw/mwworld/inventorystore.hpp b/apps/openmw/mwworld/inventorystore.hpp index c4ad51777..a974c0dae 100644 --- a/apps/openmw/mwworld/inventorystore.hpp +++ b/apps/openmw/mwworld/inventorystore.hpp @@ -109,7 +109,6 @@ namespace MWWorld virtual bool stacks (const Ptr& stack, const Ptr& item); ///< @return true if the two specified objects can stack with each other - /// @note stack is the item that is already in this container (it may be equipped) virtual int remove(const Ptr& item, int count, const Ptr& actor); ///< Remove \a count item(s) designated by \a item from this inventory.