mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:23:53 +00:00
Cosmetic changes
Rename ContainerStore::addImpl to addNewStack (it was confusing, since ContainerStore had methods named 'addImp' and 'addImpl').
This commit is contained in:
parent
aefa54d72d
commit
26e4ccb8c2
3 changed files with 9 additions and 9 deletions
|
@ -141,19 +141,19 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImp (const Ptr& ptr)
|
|||
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_100"))
|
||||
{
|
||||
int count = MWWorld::Class::get(ptr).getValue(ptr) * ptr.getRefData().getCount();
|
||||
MWWorld::ManualRef ref(esmStore, "Gold_001", count);
|
||||
|
||||
for (MWWorld::ContainerStoreIterator iter (begin(type)); iter!=end(); ++iter)
|
||||
{
|
||||
if (Misc::StringUtils::ciEqual((*iter).get<ESM::Miscellaneous>()->mRef.mRefID, "gold_001"))
|
||||
{
|
||||
(*iter).getRefData().setCount( (*iter).getRefData().getCount() + count);
|
||||
iter->getRefData().setCount(iter->getRefData().getCount() + count);
|
||||
flagAsModified();
|
||||
return iter;
|
||||
}
|
||||
}
|
||||
|
||||
return addImpl(ref.getPtr());
|
||||
MWWorld::ManualRef ref(esmStore, "Gold_001", count);
|
||||
return addNewStack(ref.getPtr());
|
||||
}
|
||||
|
||||
// determine whether to stack or not
|
||||
|
@ -169,10 +169,10 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImp (const Ptr& ptr)
|
|||
}
|
||||
}
|
||||
// if we got here, this means no stacking
|
||||
return addImpl(ptr);
|
||||
return addNewStack(ptr);
|
||||
}
|
||||
|
||||
MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImpl (const Ptr& ptr)
|
||||
MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addNewStack (const Ptr& ptr)
|
||||
{
|
||||
ContainerStoreIterator it = begin();
|
||||
|
||||
|
|
|
@ -86,8 +86,8 @@ namespace MWWorld
|
|||
/// @return the number of items actually removed
|
||||
|
||||
protected:
|
||||
ContainerStoreIterator addImpl (const Ptr& ptr);
|
||||
///< Add the item to this container (no stacking)
|
||||
ContainerStoreIterator addNewStack (const Ptr& ptr);
|
||||
///< Add the item to this container (do not try to stack it onto existing items)
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ void MWWorld::InventoryStore::equip (int slot, const ContainerStoreIterator& ite
|
|||
// add the item again with a count of count-1, then set the count of the original (that will be equipped) to 1
|
||||
int count = iterator->getRefData().getCount();
|
||||
iterator->getRefData().setCount(count-1);
|
||||
addImpl(*iterator);
|
||||
addNewStack(*iterator);
|
||||
iterator->getRefData().setCount(1);
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& npc)
|
|||
// add the item again with a count of count-1, then set the count of the original (that will be equipped) to 1
|
||||
int count = iter->getRefData().getCount();
|
||||
iter->getRefData().setCount(count-1);
|
||||
addImpl(*iter);
|
||||
addNewStack(*iter);
|
||||
iter->getRefData().setCount(1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue