File: check-for-joystick-axes-not-null.patch

package info (click to toggle)
whichwayisup 0.7.9-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,808 kB
  • sloc: python: 2,372; sh: 3; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From: Markus Koschany <apo@debian.org>
Date: Tue, 28 May 2013 18:40:34 +0200
Subject: check for joystick axes not null

---
 lib/game.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/game.py b/lib/game.py
index f0afd84..30f86fd 100644
--- a/lib/game.py
+++ b/lib/game.py
@@ -138,7 +138,7 @@ def parse_inputs(joystick = None):
   if keys[K_F10]:
     inputs["SPECIAL"] = True
 
-  if joystick != None:   # Parse joystick input
+  if joystick != None and joystick.get_numaxes() != 0:   # Parse joystick input
 
     axis0 = joystick.get_axis(0)