Skip to content

Wrong conversion for PartModuleField values using Robotic Parts #2531

@lucaelin

Description

@lucaelin

Trying to set the PartModuleFields for the DLCs robotic parts (ie. Target Angle), causes values to be clamped between 0 and 100 and rounded to the nearest integer. This is wrong for most sliders in the new DLC.

Cause of the issue seems to be

val = KOSMath.ClampToIndent(val, range.minValue, range.maxValue, range.stepIncrement);

UI_FloatRange claims that its range is always 0 to 100 with a step-size of 1.

Ignoring the clamp entirely seem to fix the issue and still cause values to be properly converted to the UIs possible values, maybe Squad moved the logic from the UI to the actual API, causing this step to be unnecessary on kOSs side?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions