JoystickInput: fix potential init problem
Don't remember the axis position before bindings are loaded
This commit is contained in:
parent
1cf7e78ae5
commit
ca02aa8a04
1 changed files with 3 additions and 1 deletions
|
@ -305,7 +305,9 @@ void FGJoystickInput::update( double dt )
|
||||||
// Do nothing if the axis position
|
// Do nothing if the axis position
|
||||||
// is unchanged; only a change in
|
// is unchanged; only a change in
|
||||||
// position fires the bindings.
|
// 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];
|
a.last_value = axis_values[j];
|
||||||
for (unsigned int k = 0; k < a.bindings[KEYMOD_NONE].size(); k++)
|
for (unsigned int k = 0; k < a.bindings[KEYMOD_NONE].size(); k++)
|
||||||
a.bindings[KEYMOD_NONE][k]->fire(axis_values[j]);
|
a.bindings[KEYMOD_NONE][k]->fire(axis_values[j]);
|
||||||
|
|
Loading…
Reference in a new issue