]> git.mxchange.org Git - flightgear.git/commitdiff
Detect joystick disconnection
authorFrederic Bouvier <fredfgfs01@free.fr>
Sun, 30 Jan 2011 20:14:32 +0000 (21:14 +0100)
committerFrederic Bouvier <fredfgfs01@free.fr>
Sun, 30 Jan 2011 20:14:32 +0000 (21:14 +0100)
src/Input/FGJoystickInput.cxx

index 17f1f3557f1afec4d85986ef207594867b49ac7f..cf7cc3319535d6a8db22db489e1623749a242bd5 100644 (file)
@@ -275,6 +275,8 @@ void FGJoystickInput::update( double dt )
       continue;
 
     js->read(&buttons, axis_values);
+    if (js->notWorking()) // If js is disconnected
+      continue;
 
                                 // Fire bindings for the axes.
     for (int j = 0; j < bindings[i].naxes; j++) {