PAD: Fix incorrect MAX_KEYS check

This commit is contained in:
Connor McLaughlin 2022-06-29 13:39:39 +10:00 committed by refractionpcsx2
parent 1a0b8fb37f
commit 444dce4aeb
2 changed files with 3 additions and 4 deletions

View File

@ -17,8 +17,6 @@
#include "common/Pcsx2Defs.h"
static const u32 MAX_KEYS = 25;
enum gamePadValues
{
PAD_UP, // Directional pad ↑
@ -46,7 +44,8 @@ enum gamePadValues
PAD_R_UP, // Right joystick (Up) ↑
PAD_R_RIGHT, // Right joystick (Right) →
PAD_R_DOWN, // Right joystick (Down) ↓
PAD_R_LEFT // Right joystick (Left) ←
PAD_R_LEFT, // Right joystick (Left) ←
MAX_KEYS,
};
static inline bool IsAnalogKey(int index)

View File

@ -546,7 +546,7 @@ bool PAD::MapController(SettingsInterface& si, u32 controller,
void PAD::SetControllerState(u32 controller, u32 bind, float value)
{
if (controller >= NUM_CONTROLLER_PORTS || bind >= MAX_KEYS)
if (controller >= NUM_CONTROLLER_PORTS || bind > MAX_KEYS)
return;
g_key_status.Set(controller, bind, value);