Skip to content

[1.12.x] Mobile Processing Lab science not awarded or deducted when transmitting via RemoteTech #859

@MADSolarV2

Description

@MADSolarV2

Workaround

A Harmony patch is available that fixes this externally without modifying RemoteTech:
https://github.com/MADSolarV2/RTScienceLabFix
https://spacedock.info/mod/4226

Bug description

When transmitting science from a Mobile Processing Lab via a RemoteTech antenna, the transmission animates and completes normally, but no science is awarded at KSC and the lab's stored science buffer is not deducted. The science can be transmitted again for free, indefinitely.

Environment

KSP: 1.12.5
RemoteTech: 1.9.12

Steps to reproduce

Process data in a Mobile Processing Lab until stored science > 0
Transmit via a RemoteTech antenna
Transmission completes (100%) but no science appears at KSC and buffer is unchanged

Root cause

This is similar to #523 / PR #524. The bug was fixed for KSP 1.0.5 but has reappeared in KSP 1.12.x with a different root cause:

from the ksp logs:

ModuleScienceLab sets ScienceData.triggered = true on lab data. RemoteTech's transmit coroutine (d__18.MoveNext) checks this flag and skips RnDCommsStream creation entirely — so the dummy subject fix from PR #524 never runs because the stream is never created.

When the stream is forced to create, a secondary crash occurs in CollectDeployedScience.OnScience via SubmitScienceData — lab data has an empty subjectID, causing String.Substring(start, length) to throw ArgumentOutOfRangeException when length < 0. A tertiary NullReferenceException also fires in ModuleScienceLab.OnTransmissionComplete
at IL 0x000a1, preventing the lab buffer from deducting even if science were awarded.

[Research & Development]: +256 data on . Subject value is NaN
ArgumentOutOfRangeException: Length is less than zero
at System.String.Substring(Int32 startIndex, Int32 length)
at CollectDeployedScience.OnScience(...)

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