Skip to content

Commit

Permalink
handle controllers being plugged in after steam input failed to init
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLubar committed Nov 13, 2023
1 parent 021897b commit 946e3a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/game/client/swarm/rd_steam_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,13 @@ void CRD_Steam_Input::OnSteamInputDeviceConnected( SteamInputDeviceConnected_t *
Assert( pController );

pController->OnConnected();

if ( g_RD_Steam_Input.m_bInitialized && g_RD_Steam_Input.m_AnalogActions.Look == g_RD_Steam_Input.m_AnalogActions.Move )
{
// we failed to initialize the first time, possibly due to there being no controllers, which causes Steam Input to avoid initializing. re-init.
g_RD_Steam_Input.Shutdown();
g_RD_Steam_Input.PostInit();
}
}

void CRD_Steam_Input::OnSteamInputDeviceDisconnected( SteamInputDeviceDisconnected_t *pParam )
Expand Down

0 comments on commit 946e3a0

Please sign in to comment.