Don't show NaN/infinity if AME has no cores (#41026)

Fixes #41025
This commit is contained in:
Pieter-Jan Briers
2025-10-21 21:15:32 +02:00
committed by GitHub
parent 1250b388f3
commit 04a2c2e968

View File

@@ -150,7 +150,7 @@ public sealed class AmeControllerSystem : EntitySystem
// how much power can be produced at the current settings, in kW // how much power can be produced at the current settings, in kW
// we don't use max. here since this is what is set in the Controller, not what the AME is actually producing // we don't use max. here since this is what is set in the Controller, not what the AME is actually producing
float targetedPowerSupply = 0; float targetedPowerSupply = 0;
if (TryGetAMENodeGroup(uid, out var group)) if (TryGetAMENodeGroup(uid, out var group) && group.CoreCount > 0)
{ {
coreCount = group.CoreCount; coreCount = group.CoreCount;
targetedPowerSupply = group.CalculatePower(controller.InjectionAmount, group.CoreCount) / 1000; targetedPowerSupply = group.CalculatePower(controller.InjectionAmount, group.CoreCount) / 1000;