Skip to content

Commit

Permalink
client: register joysupported cvar to be able to use gamepads on HL25
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross authored Dec 21, 2024
1 parent 6be11c0 commit 14dffcc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cl_dll/input_goldsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ void GoldSourceInput::Joy_AdvancedUpdate(void)
dwTemp = (DWORD) joy_advaxisz->value;
dwAxisMap[JOY_AXIS_Z] = dwTemp & 0x0000000f;
dwControlMap[JOY_AXIS_Z] = dwTemp & JOY_RELATIVE_AXIS;
dwTemp = (DWORD) joy_advaxisr->value;
dwTemp = (DWORD) joy_advaxisr->value;I've ran Half-Life under debugger and set watchpoint to joypitchsensitivity->value address. It gets changed by ClientDLL_CreateMove.
dwAxisMap[JOY_AXIS_R] = dwTemp & 0x0000000f;
dwControlMap[JOY_AXIS_R] = dwTemp & JOY_RELATIVE_AXIS;
dwTemp = (DWORD) joy_advaxisu->value;
Expand Down Expand Up @@ -1614,6 +1614,11 @@ void GoldSourceInput::IN_Init (void)
joy_wwhack1 = gEngfuncs.pfnRegisterVariable ( "joywwhack1", "0.0", 0 );
joy_wwhack2 = gEngfuncs.pfnRegisterVariable ( "joywwhack2", "0.0", 0 );
// HL25 checks this cvar and if it doesn't exist or set to zero
// it will lock any usage of gamepads
// see: https://github.com/ValveSoftware/halflife/issues/3621
gEngfuncs.pfnRegisterVariable( "joysupported", 1, 0 );

m_customaccel = gEngfuncs.pfnRegisterVariable ( "m_customaccel", "0", FCVAR_ARCHIVE );
m_customaccel_scale = gEngfuncs.pfnRegisterVariable ( "m_customaccel_scale", "0.04", FCVAR_ARCHIVE );
m_customaccel_max = gEngfuncs.pfnRegisterVariable ( "m_customaccel_max", "0", FCVAR_ARCHIVE );
Expand Down

0 comments on commit 14dffcc

Please sign in to comment.