mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Merge remote branch 'scrawl/itemstacking'
This commit is contained in:
commit
2bf12a4839
@ -45,7 +45,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::end()
|
|||||||
return ContainerStoreIterator (this);
|
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
|
/// \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
|
if ( ptr1.mCellRef->refID == ptr2.mCellRef->refID
|
||||||
|
@ -78,7 +78,7 @@ namespace MWWorld
|
|||||||
void addImpl (const Ptr& ptr);
|
void addImpl (const Ptr& ptr);
|
||||||
///< Add the item to this container (no stacking)
|
///< 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
|
///< @return true if the two specified objects can stack with each other
|
||||||
/// @note ptr1 is the item that is already in this container
|
/// @note ptr1 is the item that is already in this container
|
||||||
|
|
||||||
|
@ -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);
|
bool canStack = MWWorld::ContainerStore::stacks(ptr1, ptr2);
|
||||||
if (!canStack)
|
if (!canStack)
|
||||||
@ -211,7 +211,7 @@ bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2) const
|
|||||||
for (TSlots::const_iterator iter (mSlots.begin());
|
for (TSlots::const_iterator iter (mSlots.begin());
|
||||||
iter!=mSlots.end(); ++iter)
|
iter!=mSlots.end(); ++iter)
|
||||||
{
|
{
|
||||||
if (ptr1 == **iter)
|
if (*iter != end() && ptr1 == **iter)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ namespace MWWorld
|
|||||||
|
|
||||||
protected:
|
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
|
///< @return true if the two specified objects can stack with each other
|
||||||
/// @note ptr1 is the item that is already in this container
|
/// @note ptr1 is the item that is already in this container
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user