Correction for RemoveSoulgem instruction

actorid
scrawl 11 years ago
parent 26d972280f
commit b8583124e0

@ -282,7 +282,7 @@ namespace MWScript
{
MWWorld::Ptr ptr = R()(runtime);
const std::string &name = runtime.getStringLiteral (runtime[0].mInteger);
const std::string &name = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWWorld::InventoryStore& invStore = MWWorld::Class::get(ptr).getInventoryStore (ptr);

@ -371,15 +371,20 @@ namespace MWScript
virtual void execute (Interpreter::Runtime& runtime)
{
MWWorld::Ptr ptr = R()(runtime);
std::string soul = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWWorld::ContainerStore& store = MWWorld::Class::get (ptr).getContainerStore (ptr);
store.remove(soul, 1, ptr);
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
{
if (::Misc::StringUtils::ciEqual(it->getCellRef().mSoul, soul))
{
store.remove(*it, 1, ptr);
return;
}
}
}
};

Loading…
Cancel
Save