1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
This commit is contained in:
scrawl 2012-05-12 16:30:27 +02:00
parent 5b0251b09f
commit 9f2595183b

View File

@ -47,9 +47,11 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::end()
void MWWorld::ContainerStore::add (const Ptr& ptr)
{
int type = getType(ptr);
// determine whether to stack or not
// item stacking depends on owner, script, enchantment and name
for (MWWorld::ContainerStoreIterator iter (begin(getType(ptr))); iter!=end(); ++iter)
for (MWWorld::ContainerStoreIterator iter (begin(type)); iter!=end(); ++iter)
{
if ( iter->mCellRef->refID == ptr.mCellRef->refID
&& MWWorld::Class::get(*iter).getScript(*iter) == MWWorld::Class::get(ptr).getScript(ptr)
@ -64,7 +66,7 @@ void MWWorld::ContainerStore::add (const Ptr& ptr)
}
}
switch (getType (ptr))
switch (type)
{
case Type_Potion: potions.list.push_back (*ptr.get<ESM::Potion>()); break;
case Type_Apparatus: appas.list.push_back (*ptr.get<ESM::Apparatus>()); break;