fix NukeOpsTest (#3472)

This commit is contained in:
JrInventor05Next
2026-01-09 02:13:30 +08:00
committed by GitHub
parent 8ef9ac26e9
commit 617680fb87

View File

@@ -229,12 +229,18 @@ public sealed class NukeOpsTest
var totalSeconds = 30;
var totalTicks = (int) Math.Ceiling(totalSeconds / server.Timing.TickPeriod.TotalSeconds);
var increment = 5;
var resp = entMan.GetComponent<RespiratorComponent>(player);
// Corvax-IPC-start
var isIPC = entMan.GetComponent<MetaDataComponent>(player).EntityPrototype!.ID == "MobIpc" ? true : false;
RespiratorComponent? resp = null;
if (!isIPC)
resp = entMan.GetComponent<RespiratorComponent>(player);
// Corvax-IPC-end
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) // Corvax-IPC
Assert.That(resp!.SuffocationCycles, Is.LessThanOrEqualTo(resp.SuffocationCycleThreshold));
Assert.That(damage.TotalDamage, Is.EqualTo(FixedPoint2.Zero));
}