AlexanderDzhoganov / ksp-advanced-flybywire

Controller mod for Kerbal Space Program
MIT License
22 stars 33 forks source link

Re-implemented SAS override #33

Closed ddaf closed 9 years ago

ddaf commented 9 years ago

I discovered that SAS is now already applied to the FlightCtrlState when received in OnFlyByWire.

So I re-implemented SAS override by just taking a copy of the state before we start changing it, and if override is needed we negate pitch/yaw/roll with the recorded sas state. Works perfectly in all SAS modes from my testing, but I suggest you do a bit of testing too before a release.

Hopefully this fixes Issue https://github.com/AlexanderDzhoganov/ksp-advanced-flybywire/issues/28, a pretty bad one ><

ddaf commented 9 years ago

Hm there's still an issue with SAS intermittently taking control or limiting input, I'll try to improve it.

ddaf commented 9 years ago

Okay, finally it seems to be working properly and with all the new SAS modes. The implementation is now:

  1. Always store and remove SAS' CtrlState.
  2. If we have any input we just use that.
  3. If not we restore the saved SAS and use that.

No messy subtraction or AutoPilot.ManualOverride (which is f*cked in 0.90).