fix: al voler definir els botons dels mandos sense tindre cap mando conectat, petava tot
This commit is contained in:
@@ -111,11 +111,11 @@ void DefineButtons::checkInput()
|
||||
while (SDL_PollEvent(&event))
|
||||
{
|
||||
// Evento de salida de la aplicación
|
||||
if (event.type == SDL_QUIT)
|
||||
{
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
break;
|
||||
}
|
||||
if (event.type == SDL_QUIT)
|
||||
{
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
break;
|
||||
}
|
||||
|
||||
if (event.type == SDL_CONTROLLERBUTTONDOWN)
|
||||
doControllerButtonDown(&event.cbutton);
|
||||
@@ -126,9 +126,12 @@ void DefineButtons::checkInput()
|
||||
// Habilita el objeto
|
||||
void DefineButtons::enable(int index)
|
||||
{
|
||||
enabled = true;
|
||||
indexController = index;
|
||||
indexButton = 0;
|
||||
if (input->getNumControllers() > 0)
|
||||
{
|
||||
enabled = true;
|
||||
indexController = index;
|
||||
indexButton = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Comprueba si está habilitado
|
||||
|
||||
Reference in New Issue
Block a user