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 Vanessa
parent d52dd5dcd6
commit c20763751a
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ public sealed partial class AmeControllerSystem : EntitySystem // DeltaV - made
// 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;