Skip to content

Commit

Permalink
neutralizing controls actually clears controls
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Woerz committed Jun 27, 2014
1 parent 4a80971 commit 9c94dea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Suffixed/FlightControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ private bool CheckNeutral(string suffix, object value)
{
if (suffix == "NEUTRALIZE")
{
ResetControls();
neutral.Value = bool.Parse(value.ToString());
Unbind();
return true;
Expand All @@ -262,6 +263,18 @@ private bool CheckNeutral(string suffix, object value)
return false;
}

private void ResetControls()
{
yaw = default(float);
pitch = default(float);
roll = default(float);
fore = default(float);
starboard = default(float);
top = default(float);
wheelSteer = default(float);
wheelThrottle = default(float);
}

private void OnFlyByWire(FlightCtrlState st)
{
if (!bound) return;
Expand Down

0 comments on commit 9c94dea

Please sign in to comment.