forked from space-syndicate/space-station-14
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:
@@ -226,15 +226,20 @@ public sealed class NukeOpsTest
|
||||
Assert.That(total, Is.GreaterThan(3));
|
||||
|
||||
// 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 totalTicks = (int) Math.Ceiling(totalSeconds / server.Timing.TickPeriod.TotalSeconds);
|
||||
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);
|
||||
for (var tick = 0; tick < totalTicks; tick += 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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user