1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 13:23:53 +00:00

removed redundant code thanks to scrawl

This commit is contained in:
Tom Mason 2012-12-27 00:49:39 +00:00
parent 299a1f32ed
commit ba2301a156

View file

@ -115,32 +115,7 @@ namespace MWScript
{ {
if (toLower(iter->getCellRef().mRefID) == toLower(item)) if (toLower(iter->getCellRef().mRefID) == toLower(item))
{ {
switch(iter.getType()){ itemName = MWWorld::Class::get(*iter).getName(*iter);
case MWWorld::ContainerStore::Type_Potion:
itemName = iter->get<ESM::Potion>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Apparatus:
itemName = iter->get<ESM::Apparatus>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Armor:
itemName = iter->get<ESM::Armor>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Book:
itemName = iter->get<ESM::Book>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Clothing:
itemName = iter->get<ESM::Clothing>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Ingredient:
itemName = iter->get<ESM::Ingredient>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Light:
itemName = iter->get<ESM::Light>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Lockpick:
itemName = iter->get<ESM::Tool>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Miscellaneous:
itemName = iter->get<ESM::Miscellaneous>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Probe:
itemName = iter->get<ESM::Probe>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Repair:
itemName = iter->get<ESM::Repair>()->mBase->mName; break;
case MWWorld::ContainerStore::Type_Weapon:
itemName = iter->get<ESM::Weapon>()->mBase->mName; break;
}
if (iter->getRefData().getCount()<=count) if (iter->getRefData().getCount()<=count)
{ {