1
0
Fork 0

JoystickInput: fix potential init problem

Don't remember the axis position before bindings are loaded
This commit is contained in:
Torsten Dreyer 2011-07-17 22:26:37 +02:00
parent 1cf7e78ae5
commit ca02aa8a04

View file

@ -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]);