forked from teamnwah/openmw-tes3coop
objects with scripts attached, that are inside containers will behave correctly when the container is moved
This commit is contained in:
parent
23dada0ee4
commit
31c71c029d
1 changed files with 6 additions and 0 deletions
|
@ -685,6 +685,7 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
mWorldScene->removeObjectFromScene (ptr);
|
mWorldScene->removeObjectFromScene (ptr);
|
||||||
mLocalScripts.remove (ptr);
|
mLocalScripts.remove (ptr);
|
||||||
|
removeContainerScripts (ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -698,6 +699,8 @@ namespace MWWorld
|
||||||
CellStore *currCell = ptr.getCell();
|
CellStore *currCell = ptr.getCell();
|
||||||
bool isPlayer = ptr == mPlayer->getPlayer();
|
bool isPlayer = ptr == mPlayer->getPlayer();
|
||||||
bool haveToMove = mWorldScene->isCellActive(*currCell) || isPlayer;
|
bool haveToMove = mWorldScene->isCellActive(*currCell) || isPlayer;
|
||||||
|
|
||||||
|
removeContainerScripts(ptr);
|
||||||
|
|
||||||
if (*currCell != newCell)
|
if (*currCell != newCell)
|
||||||
{
|
{
|
||||||
|
@ -725,6 +728,8 @@ namespace MWWorld
|
||||||
MWWorld::Ptr copy =
|
MWWorld::Ptr copy =
|
||||||
MWWorld::Class::get(ptr).copyToCell(ptr, newCell);
|
MWWorld::Class::get(ptr).copyToCell(ptr, newCell);
|
||||||
|
|
||||||
|
addContainerScripts(copy, &newCell);
|
||||||
|
|
||||||
mRendering->moveObjectToCell(copy, vec, currCell);
|
mRendering->moveObjectToCell(copy, vec, currCell);
|
||||||
|
|
||||||
if (MWWorld::Class::get(ptr).isActor())
|
if (MWWorld::Class::get(ptr).isActor())
|
||||||
|
@ -1333,6 +1338,7 @@ namespace MWWorld
|
||||||
if (!script.empty()) {
|
if (!script.empty()) {
|
||||||
mLocalScripts.add(script, dropped);
|
mLocalScripts.add(script, dropped);
|
||||||
}
|
}
|
||||||
|
addContainerScripts(dropped, &cell);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue