diff --git a/cl_dll/ui/hud/OpenAG/hud_strafeguide.cpp b/cl_dll/ui/hud/OpenAG/hud_strafeguide.cpp index b4bf9d7..76ec823 100644 --- a/cl_dll/ui/hud/OpenAG/hud_strafeguide.cpp +++ b/cl_dll/ui/hud/OpenAG/hud_strafeguide.cpp @@ -9,6 +9,8 @@ #include "pm_movevars.h" #include "ref_params.h" +#include "demo_api.h" + enum border { RED_GREEN, GREEN_WHITE, @@ -36,7 +38,7 @@ int CHudStrafeGuide::VidInit() int CHudStrafeGuide::Draw(float time) { - if (hud_strafeguide->value == 0) + if (hud_strafeguide->value == 0 || gEngfuncs.pDemoAPI->IsPlayingback()) return 0; double fov = CVAR_GET_FLOAT( "default_fov" ) / 180 * M_PI / 2; diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index bfc8433..9cd3958 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -27,6 +27,8 @@ #include "hltv.h" #include "view.h" +#include "demo_api.h" + // Spectator Mode extern "C" { @@ -1644,7 +1646,10 @@ void DLLEXPORT V_CalcRefdef( struct ref_params_s *pparams ) // OpenAG gHUD.m_Speedometer.UpdateSpeed(pparams->simvel); gHUD.m_Jumpspeed.UpdateSpeed(pparams->simvel); - gHUD.m_StrafeGuide.Update(pparams); + + // FIXME: Why does an error occur when viewing DEMO? + if (!gEngfuncs.pDemoAPI->IsPlayingback()) + gHUD.m_StrafeGuide.Update(pparams); // intermission / finale rendering if( pparams->intermission )