From 2ce0c2b988b8d05320e31d98813870a55f554e37 Mon Sep 17 00:00:00 2001 From: Imarok Date: Sat, 27 Feb 2021 16:52:51 +0000 Subject: [PATCH] Remove unneeded check in JSInterface_GameView.cpp Differential Revision: https://code.wildfiregames.com/D3608 This was SVN commit r24950. --- source/graphics/scripting/JSInterface_GameView.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/graphics/scripting/JSInterface_GameView.cpp b/source/graphics/scripting/JSInterface_GameView.cpp index c84d8d64ae..1337acce48 100644 --- a/source/graphics/scripting/JSInterface_GameView.cpp +++ b/source/graphics/scripting/JSInterface_GameView.cpp @@ -113,15 +113,12 @@ void JSI_GameView::SetCameraTarget(ScriptInterface::CmptPrivate* UNUSED(pCmptPri */ void JSI_GameView::SetCameraData(ScriptInterface::CmptPrivate* UNUSED(pCmptPrivate), entity_pos_t x, entity_pos_t y, entity_pos_t z, entity_pos_t rotx, entity_pos_t roty, entity_pos_t zoom) { - if (!g_Game || !g_Game->GetWorld() || !g_Game->GetView() || !g_Game->GetWorld()->GetTerrain()) + if (!g_Game || !g_Game->GetView()) return; - CVector3D Pos = CVector3D(x.ToFloat(), y.ToFloat(), z.ToFloat()); - float RotX = rotx.ToFloat(); - float RotY = roty.ToFloat(); - float Zoom = zoom.ToFloat(); + CVector3D pos(x.ToFloat(), y.ToFloat(), z.ToFloat()); - g_Game->GetView()->SetCamera(Pos, RotX, RotY, Zoom); + g_Game->GetView()->SetCamera(pos, rotx.ToFloat(), roty.ToFloat(), zoom.ToFloat()); } /**