fixing the handling of the RespiratorComponent without checking (#42665)
* the correction itself * it will be more adequate * doc * not log - not debug * ohhh
This commit is contained in:
parent
b81a0c7a85
commit
484b4ec42c
|
|
@ -226,16 +226,18 @@ 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.
|
||||||
var totalSeconds = 30;
|
if (entMan.TryGetComponent<RespiratorComponent>(player, out var resp))
|
||||||
var totalTicks = (int) Math.Ceiling(totalSeconds / server.Timing.TickPeriod.TotalSeconds);
|
|
||||||
var increment = 5;
|
|
||||||
var resp = entMan.GetComponent<RespiratorComponent>(player);
|
|
||||||
var damage = entMan.GetComponent<DamageableComponent>(player);
|
|
||||||
for (var tick = 0; tick < totalTicks; tick += increment)
|
|
||||||
{
|
{
|
||||||
await pair.RunTicksSync(increment);
|
var totalSeconds = 30;
|
||||||
Assert.That(resp.SuffocationCycles, Is.LessThanOrEqualTo(resp.SuffocationCycleThreshold));
|
var totalTicks = (int)Math.Ceiling(totalSeconds / server.Timing.TickPeriod.TotalSeconds);
|
||||||
Assert.That(damage.TotalDamage, Is.EqualTo(FixedPoint2.Zero));
|
var increment = 5;
|
||||||
|
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));
|
||||||
|
Assert.That(damage.TotalDamage, Is.EqualTo(FixedPoint2.Zero));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the round does not end prematurely when agents are deleted in the outpost
|
// Check that the round does not end prematurely when agents are deleted in the outpost
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ public sealed class RespiratorSystem : EntitySystem
|
||||||
/// <returns>Returns true only if the air is not toxic, and it wouldn't suffocate.</returns>
|
/// <returns>Returns true only if the air is not toxic, and it wouldn't suffocate.</returns>
|
||||||
public bool CanMetabolizeInhaledAir(Entity<RespiratorComponent?> ent)
|
public bool CanMetabolizeInhaledAir(Entity<RespiratorComponent?> ent)
|
||||||
{
|
{
|
||||||
if (!Resolve(ent, ref ent.Comp))
|
if (!Resolve(ent, ref ent.Comp, false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Get the gas at our location but don't actually remove it from the gas mixture.
|
// Get the gas at our location but don't actually remove it from the gas mixture.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue