mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 23:21:20 -04:00
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
@ -685,6 +685,7 @@ namespace MWWorld
|
||||
{
|
||||
mWorldScene->removeObjectFromScene (ptr);
|
||||
mLocalScripts.remove (ptr);
|
||||
removeContainerScripts (ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -698,6 +699,8 @@ namespace MWWorld
|
||||
CellStore *currCell = ptr.getCell();
|
||||
bool isPlayer = ptr == mPlayer->getPlayer();
|
||||
bool haveToMove = mWorldScene->isCellActive(*currCell) || isPlayer;
|
||||
|
||||
removeContainerScripts(ptr);
|
||||
|
||||
if (*currCell != newCell)
|
||||
{
|
||||
@ -725,6 +728,8 @@ namespace MWWorld
|
||||
MWWorld::Ptr copy =
|
||||
MWWorld::Class::get(ptr).copyToCell(ptr, newCell);
|
||||
|
||||
addContainerScripts(copy, &newCell);
|
||||
|
||||
mRendering->moveObjectToCell(copy, vec, currCell);
|
||||
|
||||
if (MWWorld::Class::get(ptr).isActor())
|
||||
@ -1333,6 +1338,7 @@ namespace MWWorld
|
||||
if (!script.empty()) {
|
||||
mLocalScripts.add(script, dropped);
|
||||
}
|
||||
addContainerScripts(dropped, &cell);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user