1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

Merge remote branch 'scrawl/itemstacking'

This commit is contained in:
Marc Zinnschlag 2012-05-13 17:22:18 +02:00
commit 2bf12a4839
4 changed files with 5 additions and 5 deletions

View File

@ -45,7 +45,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::end()
return ContainerStoreIterator (this);
}
bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2) const
bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
{
/// \todo add current weapon/armor health, remaining lockpick/repair uses, current enchantment charge here as soon as they are implemented
if ( ptr1.mCellRef->refID == ptr2.mCellRef->refID

View File

@ -78,7 +78,7 @@ namespace MWWorld
void addImpl (const Ptr& ptr);
///< Add the item to this container (no stacking)
virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2) const;
virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2);
///< @return true if the two specified objects can stack with each other
/// @note ptr1 is the item that is already in this container

View File

@ -201,7 +201,7 @@ void MWWorld::InventoryStore::autoEquip (const MWMechanics::NpcStats& stats)
}
}
bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2) const
bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
{
bool canStack = MWWorld::ContainerStore::stacks(ptr1, ptr2);
if (!canStack)
@ -211,7 +211,7 @@ bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2) const
for (TSlots::const_iterator iter (mSlots.begin());
iter!=mSlots.end(); ++iter)
{
if (ptr1 == **iter)
if (*iter != end() && ptr1 == **iter)
return false;
}

View File

@ -67,7 +67,7 @@ namespace MWWorld
protected:
virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2) const;
virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2);
///< @return true if the two specified objects can stack with each other
/// @note ptr1 is the item that is already in this container