Skip to content

Commit

Permalink
Cosmetic changes
Browse files Browse the repository at this point in the history
Rename ContainerStore::addImpl to addNewStack (it was confusing, since
ContainerStore had methods named 'addImp' and 'addImpl').
  • Loading branch information
PotatoesMaster committed Nov 10, 2013
1 parent aefa54d commit 26e4ccb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions apps/openmw/mwworld/containerstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions apps/openmw/mwworld/containerstore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions apps/openmw/mwworld/inventorystore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 26e4ccb

Please sign in to comment.