From 4eadb3eb9d8f75febf1b6c4cb40ccdad9161937a Mon Sep 17 00:00:00 2001 From: Imarok Date: Sat, 27 Feb 2021 09:01:20 +0000 Subject: [PATCH] The `SetCameraTarget` script function should not change the orientation Reviewed by: Freagarach Differential Revision: https://code.wildfiregames.com/D3569 This was SVN commit r24940. --- source/graphics/scripting/JSInterface_GameView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/graphics/scripting/JSInterface_GameView.cpp b/source/graphics/scripting/JSInterface_GameView.cpp index b7a9b5d742..c84d8d64ae 100644 --- a/source/graphics/scripting/JSInterface_GameView.cpp +++ b/source/graphics/scripting/JSInterface_GameView.cpp @@ -103,7 +103,9 @@ void JSI_GameView::CameraMoveTo(ScriptInterface::CmptPrivate* UNUSED(pCmptPrivat */ void JSI_GameView::SetCameraTarget(ScriptInterface::CmptPrivate* UNUSED(pCmptPrivate), float x, float y, float z) { - g_Game->GetView()->ResetCameraTarget(CVector3D(x, y, z)); + if (!g_Game || !g_Game->GetView()) + return; + g_Game->GetView()->MoveCameraTarget(CVector3D(x, y, z)); } /**