Skip to content

Commit e7ac526

Browse files
committed
pad.h: Initialize m_gamepadsMap properly. This fixes crash if any game is launched before user touched any controls settings.
1 parent 30a1c46 commit e7ac526

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/pad.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Pads {
5252

5353
private:
5454
EventBus::Listener m_listener;
55-
int m_gamepadsMap[16];
55+
int m_gamepadsMap[16] = {0};
5656

5757
static const int GLFW_GAMEPAD_BUTTON_LEFT_TRIGGER = GLFW_GAMEPAD_BUTTON_LAST + 1;
5858
static const int GLFW_GAMEPAD_BUTTON_RIGHT_TRIGGER = GLFW_GAMEPAD_BUTTON_LAST + 2;

0 commit comments

Comments
 (0)