mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 23:51:09 -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);
|
mWorldScene->removeObjectFromScene (ptr);
|
||||||
mLocalScripts.remove (ptr);
|
mLocalScripts.remove (ptr);
|
||||||
|
removeContainerScripts (ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -699,6 +700,8 @@ namespace MWWorld
|
|||||||
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)
|
||||||
{
|
{
|
||||||
if (isPlayer)
|
if (isPlayer)
|
||||||
@ -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…
x
Reference in New Issue
Block a user