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) void MWWorld::ContainerStore::add (const Ptr& ptr)
{ {
int type = getType(ptr);
// determine whether to stack or not // determine whether to stack or not
// item stacking depends on owner, script, enchantment and name // 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 if ( iter->mCellRef->refID == ptr.mCellRef->refID
&& MWWorld::Class::get(*iter).getScript(*iter) == MWWorld::Class::get(ptr).getScript(ptr) && 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_Potion: potions.list.push_back (*ptr.get<ESM::Potion>()); break;
case Type_Apparatus: appas.list.push_back (*ptr.get<ESM::Apparatus>()); break; case Type_Apparatus: appas.list.push_back (*ptr.get<ESM::Apparatus>()); break;