public override bool RequestRCS(float amount, int earliestStage) { var commander = VesselCommander.GetInstance(this.vessel); if (!commander.ReturnRealRCS) { commander.RequestedRCS += amount; return(true); } return(base.RequestRCS(amount, earliestStage)); }
public static float UpdateThrust(float mainThrottle, LiquidFuelEngine engine) { if (engine.vessel == null) { MonoBehaviour.print(String.Format("[MajiirKerbalLib] Null vessel for {0}", engine.name)); return(mainThrottle); } var commander = VesselCommander.GetInstance(engine.vessel).EngineCommander; if (!commander.IsActive) { return(mainThrottle); } return(commander.Update(mainThrottle, engine)); }
protected override void onPartFixedUpdate() { var commander = VesselCommander.GetInstance(this.vessel); if (this.vessel.rootPart.RequestRCS(commander.RequestedRCS, 0)) { this.stackIcon.SetIconColor(XKCDColors.White); } else { this.stackIcon.SetIconColor(XKCDColors.SlateGrey); base.onCtrlUpd(new FlightCtrlState()); } commander.RequestedRCS = 0; commander.ReturnRealRCS = false; base.onPartFixedUpdate(); commander.ReturnRealRCS = true; }
public override bool RequestRCS(float amount, int earliestStage) { var commander = VesselCommander.GetInstance(this.vessel); if (!commander.ReturnRealRCS) { commander.RequestedRCS += amount; return(true); } if (!allowFlow) { foreach (var part in this.children) { if (part.RequestRCS(amount, earliestStage)) { return(true); } } return(false); } return(base.RequestRCS(amount, earliestStage)); }