Skip to content

Commit

Permalink
Fix HasSoulgem function to return number of soulgems
Browse files Browse the repository at this point in the history
  • Loading branch information
scrawl committed Oct 6, 2014
1 parent ea8635f commit 8097d98
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions apps/openmw/mwscript/containerextensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

Expand Down

0 comments on commit 8097d98

Please sign in to comment.