Skip to content

Commit 03b00f6

Browse files
committed
OAB stages now keep their selected body - requested by @adaniel87
1 parent af901c9 commit 03b00f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

MicroEngineerProject/MicroEngineer/Entries/OabStageInfoEntries.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ public override void RefreshData()
224224
if (i < CelestialBodyForStage.Count)
225225
{
226226
// CelestialBody already created for this stage. Attaching it to the stage.
227-
stage.CelestialBody = CelestialBodyForStage[i];
227+
stage.CelestialBody = CelestialBodyForStage[CelestialBodyForStage.Count - 1 - i];
228+
228229
}
229230
else
230231
{
@@ -243,7 +244,6 @@ public override void RefreshData()
243244
stage.Recalculate_DeltaVSeaLevel();
244245
}
245246

246-
247247
// KSP2 has a strange way of displaying stage numbers, so we need a little hack
248248
stage.Recalculate_StageNumber(Utility.VesselDeltaVComponentOAB.StageInfo.Count);
249249

@@ -264,7 +264,7 @@ public override string ValueDisplay
264264
public void UpdateCelestialBodyAtIndex(int index, string selectedBodyName)
265265
{
266266
var body = MicroCelestialBodies.Instance.GetBodyByName(selectedBodyName);
267-
CelestialBodyForStage[index] = body;
267+
CelestialBodyForStage[CelestialBodyForStage.Count - 1 - index] = body;
268268
RefreshData();
269269
}
270270
}

0 commit comments

Comments
 (0)