mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 19:36:43 +00:00
Fix positionCell not properly teleporting actors from inactive to active cells (Fixes #1516)
This commit is contained in:
parent
2ce8323a42
commit
d11a5e19f7
1 changed files with 12 additions and 3 deletions
|
@ -989,9 +989,18 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!mWorldScene->isCellActive(*currCell))
|
if (!mWorldScene->isCellActive(*currCell) && mWorldScene->isCellActive(*newCell))
|
||||||
ptr.getClass().copyToCell(ptr, *newCell, pos);
|
{
|
||||||
else if (!mWorldScene->isCellActive(*newCell))
|
MWWorld::Ptr newPtr = ptr.getClass().copyToCell(ptr, *newCell, pos);
|
||||||
|
mWorldScene->addObjectToScene(newPtr);
|
||||||
|
|
||||||
|
std::string script = newPtr.getClass().getScript(newPtr);
|
||||||
|
if (!script.empty()) {
|
||||||
|
mLocalScripts.add(script, newPtr);
|
||||||
|
}
|
||||||
|
addContainerScripts(newPtr, newCell);
|
||||||
|
}
|
||||||
|
else if (!mWorldScene->isCellActive(*newCell) && mWorldScene->isCellActive(*currCell))
|
||||||
{
|
{
|
||||||
mWorldScene->removeObjectFromScene(ptr);
|
mWorldScene->removeObjectFromScene(ptr);
|
||||||
mLocalScripts.remove(ptr);
|
mLocalScripts.remove(ptr);
|
||||||
|
|
Loading…
Reference in a new issue