Initialised all controller interfaces together on CFrame construction to fix the crash that would occur if the controller config were opened before a game was started.

This commit is contained in:
skidau
2015-02-04 18:05:22 +11:00
parent 5e645732f2
commit b9fb6ad3e8
6 changed files with 35 additions and 14 deletions

View File

@ -35,8 +35,9 @@ void Shutdown()
// if plugin isn't initialized, init and load config
void Initialize(void* const hwnd)
{
for (unsigned int i=0; i<4; ++i)
s_config.controllers.push_back(new GCKeyboard(i));
if (s_config.controllers.empty())
for (unsigned int i = 0; i < 4; ++i)
s_config.controllers.push_back(new GCKeyboard(i));
g_controller_interface.Initialize(hwnd);