fix loading of keyboard mapping for controllers > 1

This commit is contained in:
Sylvain Gadrat 2021-12-01 17:07:51 +01:00
parent 93e1dca8bc
commit 71724460f5
1 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@
//#include <unistd.h> //#include <unistd.h>
//#include <fcntl.h> //#include <fcntl.h>
#include <cerrno> #include <cerrno>
#include <cstring>
//#define MAX_JOYSTICKS 32 //#define MAX_JOYSTICKS 32
@ -414,7 +415,7 @@ int GamePad_t::init(int port, const char *guid, const char *profile)
// If we get to this point and still have not found a // If we get to this point and still have not found a
// game controller, then load default keyboard. // game controller, then load default keyboard.
if ((portNum == 0) && (devIdx < 0)) if ((portNum == 0 || strnlen(profile, 1) > 0) && (devIdx < 0))
{ {
if (loadProfile(profile)) if (loadProfile(profile))
{ {