Fix warning. It looks invalid, but that code is indeed weird.

This commit is contained in:
Alcaro 2014-10-17 21:37:02 +02:00
parent 858d859d3d
commit 77a131b0f9

View File

@ -1030,20 +1030,19 @@ static int action_toggle_input_bind_analog_dpad_mode(unsigned type, const char *
static int action_start_input_bind_device_id(unsigned type, const char *label,
unsigned action)
{
int *p = NULL;
unsigned port = 0;
int p;
if (!driver.menu)
return -1;
port = driver.menu->current_pad;
p = (int*)&g_settings.input.joypad_map[port];
*p = port;
p = driver.menu->current_pad;
if (*p < -1)
*p = -1;
else if (*p >= MAX_PLAYERS)
*p = MAX_PLAYERS - 1;
if (p < -1)
p = -1;
else if (p >= MAX_PLAYERS)
p = MAX_PLAYERS - 1;
g_settings.input.joypad_map[driver.menu->current_pad] = p;
return 0;
}