Skip to content

Commit

Permalink
Fix stage:number suffix returning stage number of the active vessel
Browse files Browse the repository at this point in the history
  • Loading branch information
sug44 committed Jan 30, 2025
1 parent 8f7b276 commit b85909b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/kOS/Suffixed/StageValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ internal StageValues(SharedObjects shared)

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

AddSuffix("NUMBER", new Suffix<ScalarValue>(() => StageManager.CurrentStage));
AddSuffix("NUMBER", new Suffix<ScalarValue>(() => shared.Vessel.currentStage));
AddSuffix("READY", new Suffix<BooleanValue>(() => shared.Vessel.isActiveVessel && StageManager.CanSeparate));
AddSuffix("RESOURCES", new Suffix<ListValue<ActiveResourceValue>>(GetResourceManifest));
AddSuffix("RESOURCESLEX", new Suffix<Lexicon>(GetResourceDictionary));
Expand Down

0 comments on commit b85909b

Please sign in to comment.