From b60b3f7d183c6734960fa5103ae3823bdb43ebcf Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 16 Nov 2018 15:09:40 +0300 Subject: [PATCH] GameUI: avoid const modifier loss --- engine/client/cl_gameui.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/client/cl_gameui.c b/engine/client/cl_gameui.c index 0415d06b..5887c341 100644 --- a/engine/client/cl_gameui.c +++ b/engine/client/cl_gameui.c @@ -715,15 +715,19 @@ for drawing playermodel previews */ static void pfnRenderScene( const ref_viewpass_t *rvp ) { + ref_viewpass_t copy; + // to avoid division by zero if( !rvp || rvp->fov_x <= 0.0f || rvp->fov_y <= 0.0f ) return; + copy = *rvp; + // don't allow special modes from menu - ((ref_viewpass_t *)&rvp)->flags = 0; + copy.flags = 0; R_Set2DMode( false ); - R_RenderFrame( rvp ); + R_RenderFrame( © ); R_Set2DMode( true ); R_PopScene(); }