Skip to content

Commit abe16c1

Browse files
committed
Merge branch 'dev'
2 parents 776c9f3 + c6c1fa0 commit abe16c1

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

.github/workflows/msbuild.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# This workflow contains a single job called "build"
1919
build:
2020
# The type of runner that the job will run on
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-22.04
2222

2323
# Steps represent a sequence of tasks that will be executed as part of the job
2424
steps:
@@ -74,7 +74,7 @@ jobs:
7474
cp -v -R "${GITHUB_WORKSPACE}/GameData" "${RELEASE_DIR}"
7575
7676
- name: Upload artifacts
77-
uses: actions/upload-artifact@v1
77+
uses: actions/upload-artifact@v4
7878
with:
7979
name: TestFlight
8080
path: ${{ steps.assemble-release.outputs.release-dir }}

.github/workflows/pr-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
pr_comment:
88
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-22.04
1010
steps:
1111
- uses: actions/github-script@v3
1212
with:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
tagged-release:
1111
name: "Tagged Release"
1212
# The type of runner that the job will run on
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1414

1515
# Steps represent a sequence of tasks that will be executed as part of the job
1616
steps:

TestFlightAPI/TestFlightAPI/TestFlightFailure.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class TestFlightFailureBase : PartModule, ITestFlightFailure
2222
[KSPField]
2323
public float duFail = 0f;
2424
[KSPField]
25+
public float duSucceed = 0f;
26+
[KSPField]
2527
public float duRepair = 0f;
2628
[KSPField]
2729
public bool oneShot = false;
@@ -163,6 +165,7 @@ public virtual void SetActiveConfig(string alias)
163165
currentConfig.TryGetValue("weight", ref weight);
164166
currentConfig.TryGetValue("failureTitle", ref failureTitle);
165167
currentConfig.TryGetValue("duFail", ref duFail);
168+
currentConfig.TryGetValue("duSucceed", ref duSucceed);
166169
currentConfig.TryGetValue("duRepair", ref duRepair);
167170
currentConfig.TryGetValue("oneShot", ref oneShot);
168171
currentConfig.TryGetValue("awardDuInPreLaunch", ref awardDuInPreLaunch);

TestFlightFailure_IgnitionFail.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ public override void OnUpdate()
275275
}
276276
else
277277
{
278+
OnIgnition();
278279
engineData.hasBeenRun = true;
279280
}
280281
}
@@ -648,6 +649,19 @@ private void ShowRestartWindowPenaltyInfo(string sPenaltyPercent)
648649
TestFlightGameSettings tfSettings = HighLogic.CurrentGame.Parameters.CustomParams<TestFlightGameSettings>();
649650
tfSettings.restartWindowPenaltyReminderShown = restartWindowPenaltyReminderShown = true;
650651
}
652+
653+
private void OnIgnition()
654+
{
655+
if (core.GetFlightData() == core.GetInitialFlightData() && (vessel.situation != Vessel.Situations.PRELAUNCH || awardDuInPreLaunch)) //Only award DU on the first ignition of each flight, and only when not attached to launch clamps.
656+
{
657+
float ignitionDU = Mathf.Max(duSucceed, core.GetMaximumData() / 40);
658+
if (verboseDebugging)
659+
{
660+
Log($"IgnitionFail: Awarding successful ignition DU: {ignitionDU:F4}");
661+
}
662+
core.ModifyFlightData(ignitionDU, true); //Award DU for first successful ignition
663+
}
664+
}
651665
}
652666
}
653667

0 commit comments

Comments
 (0)