Check if snake minigame is active before mapping joystick events

This commit is contained in:
Lactozilla 2024-06-09 01:54:02 -03:00
parent 9ff0bea92c
commit 650f7a52a7

View file

@ -582,7 +582,7 @@ boolean Snake_JoyGrabber(void *opaque, event_t *ev)
{ {
snake_t *snake = opaque; snake_t *snake = opaque;
if (ev->type == ev_joystick && ev->key == 0) if (snake != NULL && ev->type == ev_joystick && ev->key == 0)
{ {
snake->joyevents[snake->joyeventcount] = ev; snake->joyevents[snake->joyeventcount] = ev;
snake->joyeventcount++; snake->joyeventcount++;