@@ -28,7 +28,7 @@ class ThrustComputer(computers: ComputerBus) : Computer(computers) {
2828 var manualThrust: Float = 0.0f
2929 private set
3030
31- var activeInput : ControlInput ? = null
31+ var lastInput : ControlInput ? = null
3232 private set
3333 var noThrustSource: Boolean = false
3434 private set
@@ -43,19 +43,19 @@ class ThrustComputer(computers: ComputerBus) : Computer(computers) {
4343 val thrustSource: ThrustSource ? = getThrustSource()
4444
4545 val inputs: List <ControlInput > = computers.dispatchQuery(TargetThrustQuery ()).sortedBy { it.priority.value }
46- val finalInput =
47- if ( ! FAKeyMappings .isHoldingThrust()) inputs.getActiveHighestPriority().maxByOrNull { it.target }
48- else null
46+ val maxInput = inputs.getActiveHighestPriority().maxByOrNull { it.target }
47+
48+ val activeInput = if ( ! FAKeyMappings .isHoldingThrust()) maxInput else null
4949 val newTarget =
50- if (finalInput ?.status == ControlInput .Status .ACTIVE ) finalInput .target
50+ if (activeInput ?.status == ControlInput .Status .ACTIVE ) activeInput .target
5151 else manualThrust
5252
5353 targetThrust = newTarget
54- noThrustSource = thrustSource == null && (newTarget != 0.0f || (finalInput != null && finalInput .target != 0.0f ))
54+ noThrustSource = thrustSource == null && (newTarget != 0.0f || (activeInput != null && activeInput .target != 0.0f ))
5555 reverseUnsupported = newTarget < 0.0f && thrustSource?.supportsReverse == false
5656
5757 val active: Boolean = ! noThrustSource && ! reverseUnsupported
58- activeInput = finalInput ?.copy(status = if (active) finalInput .status else ControlInput .Status .UNAVAILABLE )
58+ lastInput = maxInput ?.copy(status = if (active) maxInput .status else ControlInput .Status .UNAVAILABLE )
5959
6060 if (computers.data.automationsAllowed() && targetThrust != 0.0f ) {
6161 thrustSource?.tickThrust(targetThrust.coerceIn((if (thrustSource.supportsReverse) - 1.0f else 0.0f ).. 1.0f ))
@@ -105,7 +105,7 @@ class ThrustComputer(computers: ComputerBus) : Computer(computers) {
105105
106106 override fun reset () {
107107 targetThrust = 0.0f
108- activeInput = null
108+ lastInput = null
109109 noThrustSource = false
110110 reverseUnsupported = false
111111 }
0 commit comments