mirror of
https://github.com/shadps4-emu/ext-SDL.git
synced 2024-11-23 01:59:46 +00:00
Fixed return value of SDL_AddGamepadMapping()
Fixes https://github.com/libsdl-org/SDL/issues/11095
This commit is contained in:
parent
bf54eddba9
commit
03b259893a
@ -1935,12 +1935,13 @@ static int SDL_PrivateAddGamepadMapping(const char *mappingString, SDL_GamepadMa
|
||||
bool is_xinput_mapping = false;
|
||||
bool existing = false;
|
||||
GamepadMapping_t *pGamepadMapping;
|
||||
int result = false;
|
||||
int result = -1;
|
||||
|
||||
SDL_AssertJoysticksLocked();
|
||||
|
||||
if (!mappingString) {
|
||||
return SDL_InvalidParamError("mappingString");
|
||||
SDL_InvalidParamError("mappingString");
|
||||
return -1;
|
||||
}
|
||||
|
||||
{ // Extract and verify the hint field
|
||||
@ -1992,7 +1993,7 @@ static int SDL_PrivateAddGamepadMapping(const char *mappingString, SDL_GamepadMa
|
||||
value = !value;
|
||||
}
|
||||
if (!value) {
|
||||
result = true;
|
||||
result = 0;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@ -2041,7 +2042,7 @@ static int SDL_PrivateAddGamepadMapping(const char *mappingString, SDL_GamepadMa
|
||||
}
|
||||
|
||||
if (existing) {
|
||||
result = true;
|
||||
result = 0;
|
||||
} else {
|
||||
if (is_default_mapping) {
|
||||
s_pDefaultMapping = pGamepadMapping;
|
||||
|
Loading…
Reference in New Issue
Block a user