|
|
|
@ -72,7 +72,7 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Integer sum = 0;
|
|
|
|
|
|
|
|
|
|
for (MWWorld::ContainerStoreIterator iter (store.begin()); iter!=store.end(); ++iter)
|
|
|
|
|
if (Misc::StringUtils::toLower(iter->getCellRef().mRefID) == Misc::StringUtils::toLower(item))
|
|
|
|
|
if (Misc::StringUtils::ciEqual(iter->getCellRef().mRefID, item))
|
|
|
|
|
sum += iter->getRefData().getCount();
|
|
|
|
|
|
|
|
|
|
runtime.push (sum);
|
|
|
|
@ -105,7 +105,7 @@ namespace MWScript
|
|
|
|
|
for (MWWorld::ContainerStoreIterator iter (store.begin()); iter!=store.end() && count;
|
|
|
|
|
++iter)
|
|
|
|
|
{
|
|
|
|
|
if (Misc::StringUtils::toLower(iter->getCellRef().mRefID) == Misc::StringUtils::toLower(item))
|
|
|
|
|
if (Misc::StringUtils::ciEqual(iter->getCellRef().mRefID, item))
|
|
|
|
|
{
|
|
|
|
|
itemName = MWWorld::Class::get(*iter).getName(*iter);
|
|
|
|
|
|
|
|
|
@ -163,7 +163,7 @@ namespace MWScript
|
|
|
|
|
MWWorld::ContainerStoreIterator it = invStore.begin();
|
|
|
|
|
for (; it != invStore.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
if (Misc::StringUtils::toLower(it->getCellRef().mRefID) == Misc::StringUtils::toLower(item))
|
|
|
|
|
if (Misc::StringUtils::ciEqual(it->getCellRef().mRefID, item))
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (it == invStore.end())
|
|
|
|
@ -263,7 +263,7 @@ namespace MWScript
|
|
|
|
|
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot)
|
|
|
|
|
{
|
|
|
|
|
MWWorld::ContainerStoreIterator it = invStore.getSlot (slot);
|
|
|
|
|
if (it != invStore.end() && Misc::StringUtils::toLower(it->getCellRef().mRefID) == Misc::StringUtils::toLower(item))
|
|
|
|
|
if (it != invStore.end() && Misc::StringUtils::ciEqual(it->getCellRef().mRefID, item))
|
|
|
|
|
{
|
|
|
|
|
runtime.push(1);
|
|
|
|
|
return;
|
|
|
|
@ -282,8 +282,7 @@ namespace MWScript
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
const std::string &name = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
|
std::string creatureName = Misc::StringUtils::toLower (const_cast<std::string &>(name));
|
|
|
|
|
const std::string &name = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWWorld::InventoryStore& invStore = MWWorld::Class::get(ptr).getInventoryStore (ptr);
|
|
|
|
@ -291,7 +290,7 @@ namespace MWScript
|
|
|
|
|
it != invStore.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (Misc::StringUtils::toLower(it->getCellRef().mSoul) == Misc::StringUtils::toLower(creatureName))
|
|
|
|
|
if (Misc::StringUtils::ciEqual(it->getCellRef().mSoul, name))
|
|
|
|
|
{
|
|
|
|
|
runtime.push(1);
|
|
|
|
|
return;
|
|
|
|
|