1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 19:45:35 +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:
Emanuel Guevel 2013-10-21 00:33:47 +02:00
parent aefa54d72d
commit 26e4ccb8c2
3 changed files with 9 additions and 9 deletions

View file

@ -141,19 +141,19 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImp (const Ptr& ptr)
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_100")) || Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_100"))
{ {
int count = MWWorld::Class::get(ptr).getValue(ptr) * ptr.getRefData().getCount(); 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) for (MWWorld::ContainerStoreIterator iter (begin(type)); iter!=end(); ++iter)
{ {
if (Misc::StringUtils::ciEqual((*iter).get<ESM::Miscellaneous>()->mRef.mRefID, "gold_001")) 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(); flagAsModified();
return iter; return iter;
} }
} }
return addImpl(ref.getPtr()); MWWorld::ManualRef ref(esmStore, "Gold_001", count);
return addNewStack(ref.getPtr());
} }
// determine whether to stack or not // 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 // 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(); ContainerStoreIterator it = begin();

View file

@ -86,8 +86,8 @@ namespace MWWorld
/// @return the number of items actually removed /// @return the number of items actually removed
protected: protected:
ContainerStoreIterator addImpl (const Ptr& ptr); ContainerStoreIterator addNewStack (const Ptr& ptr);
///< Add the item to this container (no stacking) ///< Add the item to this container (do not try to stack it onto existing items)
public: public:

View file

@ -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 // 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(); int count = iterator->getRefData().getCount();
iterator->getRefData().setCount(count-1); iterator->getRefData().setCount(count-1);
addImpl(*iterator); addNewStack(*iterator);
iterator->getRefData().setCount(1); 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 // 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(); int count = iter->getRefData().getCount();
iter->getRefData().setCount(count-1); iter->getRefData().setCount(count-1);
addImpl(*iter); addNewStack(*iter);
iter->getRefData().setCount(1); iter->getRefData().setCount(1);
} }
} }