$NetBSD: patch-ak,v 1.8 2009/01/12 19:22:18 adam Exp $ --- src/libgame/system.c.orig 2008-01-25 22:25:33.000000000 +0100 +++ src/libgame/system.c @@ -1494,10 +1494,14 @@ void InitJoysticks() return; /* joysticks generally deactivated by compile-time directive */ #endif + /* pkgsrc: InitJoystick will be called more than once, so reset + * the state variable 'joystick' only if there's no joystick available (yet) + */ /* always start with reliable default values */ - joystick.status = JOYSTICK_NOT_AVAILABLE; - for (i = 0; i < MAX_PLAYERS; i++) - joystick.fd[i] = -1; /* joystick device closed */ + if (joystick.status == JOYSTICK_NOT_AVAILABLE) { + for (i=0; i