From bbae5359facf5e39cd7d8dd91558c764db567024 Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Mon, 1 Mar 2021 17:15:41 -0500 Subject: [PATCH] Fix gcc8 compilation issue on Linux. --- radiant/camwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 905b1118..e826fbfc 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -433,6 +433,8 @@ void CamWnd::Cam_KeyControl( float dtime ) { static vec3_t avelocity; static vec3_t velocity; + const vec3_t up = { 0, 0, 1 }; + // Update angles if ( m_Camera.movementflags & MOVE_ROTLEFT ) { avelocity[YAW] += dtime * g_PrefsDlg.m_nAngleSpeed; @@ -476,14 +478,14 @@ void CamWnd::Cam_KeyControl( float dtime ) { VectorMA( velocity, dtime * g_PrefsDlg.m_nMoveSpeed, m_Camera.right, velocity ); } if ( m_Camera.movementflags & MOVE_UP ) { - VectorMA( velocity, dtime * g_PrefsDlg.m_nMoveSpeed, (vec3_t) { 0, 0, 1 }, velocity); + VectorMA( velocity, dtime * g_PrefsDlg.m_nMoveSpeed, up, velocity ); } if ( m_Camera.movementflags & MOVE_DOWN ) { - VectorMA( velocity, -dtime * g_PrefsDlg.m_nMoveSpeed, (vec3_t) { 0, 0, 1 }, velocity); + VectorMA( velocity, -dtime * g_PrefsDlg.m_nMoveSpeed, up, velocity ); } // Now move the origin by the scaled velocity - VectorMA( m_Camera.origin, dtime, velocity, m_Camera.origin); + VectorMA( m_Camera.origin, dtime, velocity, m_Camera.origin ); // And then add some friction to slow us down VectorScale( velocity, 1.f - dtime, velocity );