evdev/dupcheck: Don't check unassigned buttons

Also removes the trailing whitespaces.
This commit is contained in:
Christoph "baka0815" Schwerdtfeger 2018-08-13 13:10:59 +02:00
parent 989c0fa776
commit 7029af98a3
1 changed files with 24 additions and 20 deletions

View File

@ -199,6 +199,10 @@
bool input_evdev_button_assigned(EvdevControllerMapping* mapping, int button)
{
// Don't check unassigned buttons
if (button == -1)
return false;
return ((mapping->Btn_A == button)
|| (mapping->Btn_B == button)
|| (mapping->Btn_C == button)