Rename arguments again

This commit is contained in:
scrawl 2013-11-12 23:12:56 +01:00
parent 700d06764c
commit 3c6a391507
4 changed files with 20 additions and 20 deletions

View file

@ -77,31 +77,31 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::end()
return ContainerStoreIterator (this); return ContainerStoreIterator (this);
} }
bool MWWorld::ContainerStore::stacks(const Ptr& stack, const Ptr& item) bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
{ {
const MWWorld::Class& cls1 = MWWorld::Class::get(stack); const MWWorld::Class& cls1 = MWWorld::Class::get(ptr1);
const MWWorld::Class& cls2 = MWWorld::Class::get(item); const MWWorld::Class& cls2 = MWWorld::Class::get(ptr2);
/// \todo add current enchantment charge here when it is implemented /// \todo add current enchantment charge here when it is implemented
return stack != item // an item never stacks onto itself return ptr1 != ptr2 // an item never stacks onto itself
&& Misc::StringUtils::ciEqual(stack.getCellRef().mRefID, item.getCellRef().mRefID) && Misc::StringUtils::ciEqual(ptr1.getCellRef().mRefID, ptr2.getCellRef().mRefID)
&& stack.getCellRef().mOwner == item.getCellRef().mOwner && ptr1.getCellRef().mOwner == ptr2.getCellRef().mOwner
&& stack.getCellRef().mSoul == item.getCellRef().mSoul && ptr1.getCellRef().mSoul == ptr2.getCellRef().mSoul
// item with a script never stacks // item with a script never stacks
&& cls1.getScript(stack) == "" && cls1.getScript(ptr1) == ""
&& cls2.getScript(item) == "" && cls2.getScript(ptr2) == ""
// item with enchantment never stacks (we could revisit this later, // item with enchantment never stacks (we could revisit this later,
// but for now it makes selecting items in the spell window much easier) // but for now it makes selecting items in the spell window much easier)
&& cls1.getEnchantment(stack) == "" && cls1.getEnchantment(ptr1) == ""
&& cls2.getEnchantment(item) == "" && cls2.getEnchantment(ptr2) == ""
// item that is already partly used up never stacks // item that is already partly used up never stacks
&& (!cls1.hasItemHealth(stack) || stack.getCellRef().mCharge == -1 && (!cls1.hasItemHealth(ptr1) || ptr1.getCellRef().mCharge == -1
|| cls1.getItemMaxHealth(stack) == stack.getCellRef().mCharge) || cls1.getItemMaxHealth(ptr1) == ptr1.getCellRef().mCharge)
&& (!cls2.hasItemHealth(item) || item.getCellRef().mCharge == -1 && (!cls2.hasItemHealth(ptr2) || ptr2.getCellRef().mCharge == -1
|| cls2.getItemMaxHealth(item) == item.getCellRef().mCharge); || cls2.getItemMaxHealth(ptr2) == ptr2.getCellRef().mCharge);
} }
MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr, const Ptr& actorPtr) MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr, const Ptr& actorPtr)

View file

@ -91,7 +91,7 @@ namespace MWWorld
public: public:
virtual bool stacks (const Ptr& stack, const Ptr& item); 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
void fill (const ESM::InventoryList& items, const std::string& owner, const MWWorld::ESMStore& store); void fill (const ESM::InventoryList& items, const std::string& owner, const MWWorld::ESMStore& store);

View file

@ -285,9 +285,9 @@ void MWWorld::InventoryStore::flagAsModified()
mMagicEffectsUpToDate = false; mMagicEffectsUpToDate = false;
} }
bool MWWorld::InventoryStore::stacks(const Ptr& stack, const Ptr& item) bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
{ {
bool canStack = MWWorld::ContainerStore::stacks(stack, item); bool canStack = MWWorld::ContainerStore::stacks(ptr1, ptr2);
if (!canStack) if (!canStack)
return false; return false;
@ -295,7 +295,7 @@ bool MWWorld::InventoryStore::stacks(const Ptr& stack, const Ptr& item)
for (TSlots::const_iterator iter (mSlots.begin()); for (TSlots::const_iterator iter (mSlots.begin());
iter!=mSlots.end(); ++iter) iter!=mSlots.end(); ++iter)
{ {
if (*iter != end() && (stack == **iter || item == **iter)) if (*iter != end() && (ptr1 == **iter || ptr2 == **iter))
{ {
bool stackWhenEquipped = MWWorld::Class::get(**iter).getEquipmentSlots(**iter).second; bool stackWhenEquipped = MWWorld::Class::get(**iter).getEquipmentSlots(**iter).second;
if (!stackWhenEquipped) if (!stackWhenEquipped)

View file

@ -107,7 +107,7 @@ namespace MWWorld
///< \attention This function is internal to the world model and should not be called from ///< \attention This function is internal to the world model and should not be called from
/// outside. /// outside.
virtual bool stacks (const Ptr& stack, const Ptr& item); 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
virtual int remove(const Ptr& item, int count, const Ptr& actor); virtual int remove(const Ptr& item, int count, const Ptr& actor);