From 675e22d7358531e03376731cfc70f16cd0c93036 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 8 Oct 2026 16:33:31 +0200 Subject: [PATCH] Operability test: assert performance above the online threshold, not above zero Entity.UpdatePerformance sets ThermalOnline only when performance exceeds EntitySettings.ShutdownPerformance. A weapon at 0.006 performance at a hull's starting temperature passed the old "> 0" test but could never fire. The threshold is read from production (new EntitySettings().ShutdownPerformance). Co-Authored-By: Claude Opus 5.5 --- .../ShippedWeaponOperabilityTests.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/ShippedWeaponOperabilityTests.cs b/tests/Aetheria.Shared.Tests/ShippedWeaponOperabilityTests.cs index 7a9d494a2..537fbc3a9 100644 --- a/tests/Aetheria.Shared.Tests/ShippedWeaponOperabilityTests.cs +++ b/tests/Aetheria.Shared.Tests/ShippedWeaponOperabilityTests.cs @@ -1,7 +1,8 @@ using System.Linq; using Xunit; -// A weapon is thermally dead at 0 performance: ThermalOnline is false and wear runs at full rate. Hull cells +// A weapon is thermally online only while its performance exceeds the shutdown threshold (Entity.UpdatePerformance +// compares against EntitySettings.ShutdownPerformance), and wear runs at full rate below it. Hull cells // start at Entity.StartingCellTemperature, so every shipped weapon must perform there, or a ship fitted with it // can never fire it. The catalog comes from the shipped GameData/Aetheria.cc and the temperature from the // constant Entity builds its cells with, so a unit slip in authoring (celsius for kelvin) fails here. @@ -14,7 +15,10 @@ public sealed class ShippedWeaponOperabilityTests var weapons = cache.GetAll().OfType().ToArray(); Assert.NotEmpty(weapons); - var dead = weapons.Where(weapon => weapon.Performance(Entity.StartingCellTemperature) <= 0f) + var threshold = new EntitySettings().ShutdownPerformance; + Assert.True(threshold > 0f); + + var dead = weapons.Where(weapon => weapon.Performance(Entity.StartingCellTemperature) <= threshold) .Select(weapon => $"{weapon.Name} ({weapon.MinimumTemperature}..{weapon.MaximumTemperature} K)").ToArray(); Assert.Empty(dead);