mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
Fix HasSoulgem function to return number of soulgems
This commit is contained in:
parent
9cce3bc31b
commit
012928c082
1 changed files with 3 additions and 6 deletions
|
@ -290,18 +290,15 @@ namespace MWScript
|
||||||
const std::string &name = runtime.getStringLiteral (runtime[0].mInteger);
|
const std::string &name = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore (ptr);
|
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore (ptr);
|
||||||
for (MWWorld::ContainerStoreIterator it = invStore.begin(MWWorld::ContainerStore::Type_Miscellaneous);
|
for (MWWorld::ContainerStoreIterator it = invStore.begin(MWWorld::ContainerStore::Type_Miscellaneous);
|
||||||
it != invStore.end(); ++it)
|
it != invStore.end(); ++it)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (::Misc::StringUtils::ciEqual(it->getCellRef().getSoul(), name))
|
if (::Misc::StringUtils::ciEqual(it->getCellRef().getSoul(), name))
|
||||||
{
|
++count;
|
||||||
runtime.push(1);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
runtime.push(count);
|
||||||
runtime.push(0);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue