mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 15:35:23 +00:00
Fix HasSoulgem function to return number of soulgems
This commit is contained in:
parent
ea8635f44c
commit
8097d9801d
@ -290,18 +290,15 @@ namespace MWScript
|
||||
const std::string &name = runtime.getStringLiteral (runtime[0].mInteger);
|
||||
runtime.pop();
|
||||
|
||||
int count = 0;
|
||||
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore (ptr);
|
||||
for (MWWorld::ContainerStoreIterator it = invStore.begin(MWWorld::ContainerStore::Type_Miscellaneous);
|
||||
it != invStore.end(); ++it)
|
||||
{
|
||||
|
||||
if (::Misc::StringUtils::ciEqual(it->getCellRef().getSoul(), name))
|
||||
{
|
||||
runtime.push(1);
|
||||
return;
|
||||
}
|
||||
++count;
|
||||
}
|
||||
runtime.push(0);
|
||||
runtime.push(count);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user