The detailed info text for the SolarPanel is not updated when only the current power changes.
Instead it is only updated whenever the maximum power changes.
Changes to maximum power happen frequently if the sun rotates or ships (but not players) fly between the sun and the panel.
However if sun rotation is disabled it is quite likely that the maximum power does not change and thus the detailed text will not be updated.
This is problematic because the text also displays the current output which will be outdated.
To reproduce:
Create a new empty world without sun rotation.
Add one solar panel, a control panel, and a thruster.
Turn thrust override on.
Observe that the solar panel does not display any current output.
Possible cause / fix
The info text is updated in the UpdateDisplay method in MySolarPanel but only if the maximum power changed:
public override void UpdateBeforeSimulation100()
{
base.UpdateBeforeSimulation100();
if (CubeGrid.Physics == null)
return;
float maxPowerOutput = SolarComponent.MaxOutput * SolarPanelDefinition.MaxPowerOutput;
if (maxPowerOutput != SourceComp.MaxOutput)
{
float oldPowerOutput = SourceComp.MaxOutput;
SourceComp.SetMaxOutput(maxPowerOutput);
if (oldPowerOutput != maxPowerOutput)
{
SourceComp.SetProductionEnabledByType(MyResourceDistributorComponent.ElectricityId, maxPowerOutput != 0f);
UpdateDisplay();
}
}
}
This should be changed to update the text also if the current power changed.
Description
The detailed info text for the SolarPanel is not updated when only the current power changes. Instead it is only updated whenever the maximum power changes. Changes to maximum power happen frequently if the sun rotates or ships (but not players) fly between the sun and the panel. However if sun rotation is disabled it is quite likely that the maximum power does not change and thus the detailed text will not be updated. This is problematic because the text also displays the current output which will be outdated.
To reproduce:
Possible cause / fix
The info text is updated in the
UpdateDisplay
method inMySolarPanel
but only if the maximum power changed:This should be changed to update the text also if the current power changed.