Skip to content

Commit

Permalink
Fix crash on older GoldSource versions that didn't have m_rawinput cvar
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave committed Mar 2, 2023
1 parent c14ce40 commit 0c8cf83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cl_dll/input_goldsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ void IN_SetMouseMode(bool enable)
if (mouseparmsvalid)
restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0);

m_bRawInput = m_rawinput->value != 0;
m_bRawInput = m_rawinput && m_rawinput->value != 0;
if(m_bRawInput)
{
#if USE_SDL2
Expand Down Expand Up @@ -789,7 +789,7 @@ void GoldSourceInput::IN_GetMouseDelta( int *pOutX, int *pOutY)

bool lockEntered = MouseThread_ActiveLock_Enter();

m_bRawInput = m_rawinput->value != 0;
m_bRawInput = m_rawinput && m_rawinput->value != 0;

if(m_bRawInput && !isMouseRelative)
{
Expand Down Expand Up @@ -1574,7 +1574,7 @@ void GoldSourceInput::IN_Init (void)

#if _WIN32
m_rawinput = gEngfuncs.pfnGetCvarPointer("m_rawinput");
m_bRawInput = m_rawinput->value != 0;
m_bRawInput = m_rawinput && m_rawinput->value != 0;
m_bMouseThread = gEngfuncs.CheckParm ("-mousethread", NULL ) != NULL;
m_mousethread_sleep = gEngfuncs.pfnRegisterVariable ( "m_mousethread_sleep", "1", FCVAR_ARCHIVE ); // default to less than 1000 Hz

Expand Down

0 comments on commit 0c8cf83

Please sign in to comment.