From: Torsten Dreyer Date: Sun, 17 Jul 2011 20:26:37 +0000 (+0200) Subject: JoystickInput: fix potential init problem X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ca02aa8a049e25d544321d293b0ca23dac350ef2;p=flightgear.git JoystickInput: fix potential init problem Don't remember the axis position before bindings are loaded --- diff --git a/src/Input/FGJoystickInput.cxx b/src/Input/FGJoystickInput.cxx index 3f490f5cb..0d0a86ce9 100644 --- a/src/Input/FGJoystickInput.cxx +++ b/src/Input/FGJoystickInput.cxx @@ -305,7 +305,9 @@ void FGJoystickInput::update( double dt ) // Do nothing if the axis position // is unchanged; only a change in // position fires the bindings. - if (fabs(axis_values[j] - a.last_value) > a.tolerance) { + // But only if there are bindings + if (fabs(axis_values[j] - a.last_value) > a.tolerance + && a.bindings[KEYMOD_NONE].size() > 0 ) { a.last_value = axis_values[j]; for (unsigned int k = 0; k < a.bindings[KEYMOD_NONE].size(); k++) a.bindings[KEYMOD_NONE][k]->fire(axis_values[j]);