forked from mirror/openmw-tes3mp
Add new script instance when a container item is unstacked (Bug #2962)
This commit is contained in:
parent
029a86267b
commit
91bf5ae237
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue