Fix NukeOpsTest for IPC species

Skip respirator checks when nukie spawns as IPC (android) since they
don't have lungs. Fixes test failure with RespiratorComponent.

Based on Corvax fix: space-syndicate/space-station-14#3472

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-18 21:04:01 +01:00
committed by Codex
parent cf2b1337cb
commit 8a46ade2b0

View File

@@ -226,15 +226,20 @@ public sealed class NukeOpsTest
Assert.That(total, Is.GreaterThan(3)); Assert.That(total, Is.GreaterThan(3));
// Check the nukie commander passed basic training and figured out how to breathe. // Check the nukie commander passed basic training and figured out how to breathe.
// Skip respirator checks for IPC (they don't breathe)
var isIpc = entMan.GetComponent<MetaDataComponent>(player).EntityPrototype?.ID == "MobIpc";
var totalSeconds = 30; var totalSeconds = 30;
var totalTicks = (int) Math.Ceiling(totalSeconds / server.Timing.TickPeriod.TotalSeconds); var totalTicks = (int) Math.Ceiling(totalSeconds / server.Timing.TickPeriod.TotalSeconds);
var increment = 5; var increment = 5;
var resp = entMan.GetComponent<RespiratorComponent>(player); RespiratorComponent? resp = null;
if (!isIpc)
resp = entMan.GetComponent<RespiratorComponent>(player);
var damage = entMan.GetComponent<DamageableComponent>(player); var damage = entMan.GetComponent<DamageableComponent>(player);
for (var tick = 0; tick < totalTicks; tick += increment) for (var tick = 0; tick < totalTicks; tick += increment)
{ {
await pair.RunTicksSync(increment); await pair.RunTicksSync(increment);
Assert.That(resp.SuffocationCycles, Is.LessThanOrEqualTo(resp.SuffocationCycleThreshold)); if (!isIpc)
Assert.That(resp!.SuffocationCycles, Is.LessThanOrEqualTo(resp.SuffocationCycleThreshold));
Assert.That(damage.TotalDamage, Is.EqualTo(FixedPoint2.Zero)); Assert.That(damage.TotalDamage, Is.EqualTo(FixedPoint2.Zero));
} }