1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 21:40:03 +00:00

Merge remote-tracking branch 'scrawl/unstack_script'

This commit is contained in:
Marc Zinnschlag 2015-10-07 08:12:02 +02:00
commit 379d13c7b9

View File

@ -140,7 +140,11 @@ void MWWorld::ContainerStore::unstack(const Ptr &ptr, const Ptr& container)
{ {
if (ptr.getRefData().getCount() <= 1) if (ptr.getRefData().getCount() <= 1)
return; return;
addNewStack(ptr, ptr.getRefData().getCount()-1); MWWorld::ContainerStoreIterator it = addNewStack(ptr, ptr.getRefData().getCount()-1);
const std::string script = it->getClass().getScript(*it);
if (!script.empty())
MWBase::Environment::get().getWorld()->getLocalScripts().add(script, *it);
remove(ptr, ptr.getRefData().getCount()-1, container); remove(ptr, ptr.getRefData().getCount()-1, container);
} }