satoshinm / NetCraft

Web-based fork of fogleman/Craft ⛺
https://satoshinm.github.io/NetCraft/
MIT License
57 stars 13 forks source link

Crash when connecting joysticks in fullscreen on native build #81

Closed satoshinm closed 7 years ago

satoshinm commented 7 years ago

Found when testing https://github.com/satoshinm/NetCraft/pull/63 - vr, fullscreen, attach controller, crash:

Joystick connected: 0 Nimbus
craft was compiled with optimization - stepping may behave oddly; variables may not be available.
Process 98138 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
    frame #0: 0x0000000100011c13 craft`handle_mouse_input at main.c:2777 [opt]
   2774             mx = touch_clientX;
   2775             my = touch_clientY;
   2776         } else if (g->gamepad_connected != -1) {
-> 2777             mx = px + g->gamepad_state.axis[GAMEPAD_RIGHT_STICK_HORIZONTAL] * GAMEPAD_LOOK_SENSITIVITY;
   2778             my = py + g->gamepad_state.axis[GAMEPAD_RIGHT_STICK_VERTICAL] * GAMEPAD_LOOK_SENSITIVITY;
   2779         } else {
   2780             glfwGetCursorPos(g->window, &mx, &my);
(lldb)