$NetBSD: patch-ak,v 1.1 2002/10/29 19:07:54 heinz Exp $

--- src/libgame/system.c.orig	Sat Aug 10 15:09:49 2002
+++ src/libgame/system.c
@@ -874,10 +874,16 @@
   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<MAX_PLAYERS; i++)
+      joystick.fd[i] = -1;		/* joystick device closed */
+  }
 
 #if defined(TARGET_SDL)
   SDLInitJoysticks();
