From f2edf05a557b2cad624fdf77f66d44f56cfa4eb6 Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Wed, 19 Jul 2023 10:39:54 +0200 Subject: [PATCH] Move camera update after teleporting from worldimp to camera.lua --- apps/openmw/mwworld/worldimp.cpp | 2 -- files/data/scripts/omw/camera/camera.lua | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 4c090b2701..f6f4058e1b 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -971,7 +971,6 @@ namespace MWWorld removeContainerScripts(getPlayerPtr()); mWorldScene->changeToInteriorCell(cellName, position, adjustPlayerPos, changeEvent); addContainerScripts(getPlayerPtr(), getPlayerPtr().getCell()); - mRendering->getCamera()->instantTransition(); } void World::changeToCell( @@ -996,7 +995,6 @@ namespace MWWorld else mWorldScene->changeToInteriorCell(destinationCell->getNameId(), position, adjustPlayerPos, changeEvent); addContainerScripts(getPlayerPtr(), getPlayerPtr().getCell()); - mRendering->getCamera()->instantTransition(); } float World::getMaxActivationDistance() const diff --git a/files/data/scripts/omw/camera/camera.lua b/files/data/scripts/omw/camera/camera.lua index 1280a574fa..6fcb46bb2f 100644 --- a/files/data/scripts/omw/camera/camera.lua +++ b/files/data/scripts/omw/camera/camera.lua @@ -281,6 +281,9 @@ return { end move360.onInputAction(action) end, + onTeleported = function() + camera.instantTransition() + end, onActive = init, onLoad = function(data) if data and data.distance then third_person.baseDistance = data.distance end