Fix positionCell not properly teleporting actors from inactive to active cells (Fixes #1516)

deque
scrawl 11 years ago
parent 2ce8323a42
commit d11a5e19f7

@ -989,9 +989,18 @@ namespace MWWorld
}
else
{
if (!mWorldScene->isCellActive(*currCell))
ptr.getClass().copyToCell(ptr, *newCell, pos);
else if (!mWorldScene->isCellActive(*newCell))
if (!mWorldScene->isCellActive(*currCell) && 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);
mLocalScripts.remove(ptr);

Loading…
Cancel
Save