Skip to content

Local scanners detect bands with an altitude offset #65

Description

@Starstrider42

This bug can be reproduced with KSP 1.12.5, Module Manager 4.2.3, SpaceDust 0.5.5, and the custom config attached below.

Steps to reproduce:

  1. Place the following config in GameData:
// Config for testing SpaceDust local resource handling

// Turn off automatic discovery
@SPACEDUST_RESOURCE:HAS[#body[Kerbin]]:FINAL {
    @RESOURCEBAND {
        @alwaysDiscovered = false
		@alwaysIdentified = false
    }
}

@SPACEDUST_RESOURCE:HAS[#resourceName[XenonGas]&#body[Kerbin]]:FINAL {
    @RESOURCEBAND[kerbinAtmo] {
        @altLowerBound = -1000000       // Radius + altLowerBound is negative
		@minAbundance = 1               // Work around SpaceDust#63
		@maxAbundance = 1
    }
}

@SPACEDUST_RESOURCE:HAS[#resourceName[Oxidizer]&#body[Kerbin]]:FINAL {
    @RESOURCEBAND[kerbinAtmo] {
        // Radius + altLowerBound is 599,500 m
		@minAbundance = 1               // Work around SpaceDust#63
		@maxAbundance = 1
    }
}
  1. Create a new sandbox game.
  2. Create a minimal spacecraft containing the PT-SN1-FER Trace Gas Analyzer.
  3. Send the spacecraft to the launchpad.
  4. Without launching, start scanning with the analyzer
  5. While the part action window correctly reports the local density of both XenonGas and Oxidizer as 1 t/m^3, only the XenonGas band is discovered.

There seems to be some inconsistency in the code about whether methods take altitude or radius; I can't tell which was the original intent.

I think altitude scanners may have a similar bug, but haven't set up a test for them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions