summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 844994d0..5ec3b76a 100644
--- a/src/core.c
+++ b/src/core.c
@@ -3172,7 +3172,8 @@ static void PollInputEvents(void)
// NOTE: GLFW3 joystick functionality not available in web
#if defined(PLATFORM_WEB)
// Get number of gamepads connected
- int numGamepads = emscripten_get_num_gamepads();
+ int numGamepads = 0;
+ if (emscripten_sample_gamepad_data() == EMSCRIPTEN_RESULT_SUCCESS) numGamepads = emscripten_get_num_gamepads();
for (int i = 0; (i < numGamepads) && (i < MAX_GAMEPADS); i++)
{