From 257e3390c94e52a085c11055be91cd12b65886be Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Sun, 30 Jan 2011 21:14:32 +0100 Subject: [PATCH] Detect joystick disconnection --- src/Input/FGJoystickInput.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Input/FGJoystickInput.cxx b/src/Input/FGJoystickInput.cxx index 17f1f3557..cf7cc3319 100644 --- a/src/Input/FGJoystickInput.cxx +++ b/src/Input/FGJoystickInput.cxx @@ -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++) { -- 2.39.5