Skip to content

Commit c1af606

Browse files
authored
Fix stage:number suffix returning stage number of the active vessel (#3130)
1 parent 8f7b276 commit c1af606

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/kOS/Suffixed/StageValues.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ internal StageValues(SharedObjects shared)
4040

4141
private void InitializeSuffixes()
4242
{
43-
// TODO: TEST IF THIS IS BROKEN WHEN CPU VESSEL != ACTIVE VESSEL
44-
// Some of these values come from StageManager, which is part of the UI and
45-
// only refers to the "active vessel", while others come from shared.Vessel and
46-
// thus refer to the CPU vessel. Those aren't always the same thing:
43+
// WARNING: StageManager refers to the active vessel and not the CPU vessel
4744

48-
AddSuffix("NUMBER", new Suffix<ScalarValue>(() => StageManager.CurrentStage));
45+
AddSuffix("NUMBER", new Suffix<ScalarValue>(() => shared.Vessel.currentStage));
4946
AddSuffix("READY", new Suffix<BooleanValue>(() => shared.Vessel.isActiveVessel && StageManager.CanSeparate));
5047
AddSuffix("RESOURCES", new Suffix<ListValue<ActiveResourceValue>>(GetResourceManifest));
5148
AddSuffix("RESOURCESLEX", new Suffix<Lexicon>(GetResourceDictionary));

0 commit comments

Comments
 (0)