1
0
Fork 1
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:
scrawl 2014-10-06 14:36:29 +02:00
parent 9cce3bc31b
commit 012928c082

View file

@ -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);
} }
}; };