Paradox Clones spawn with their suit sensors off (#35909)

* sensors off

* remove import

* Update Content.Server/Medical/SuitSensors/SuitSensorSystem.cs

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
This commit is contained in:
slarticodefast
2025-03-18 21:07:06 +01:00
committed by GitHub
parent 0a166e2af0
commit 943d703685
2 changed files with 22 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ using Content.Shared.DoAfter;
using Content.Shared.Examine;
using Content.Shared.GameTicking;
using Content.Shared.Interaction;
using Content.Shared.Inventory;
using Content.Shared.Medical.SuitSensor;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
@@ -44,6 +45,7 @@ public sealed class SuitSensorSystem : EntitySystem
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
public override void Initialize()
{
@@ -347,6 +349,20 @@ public sealed class SuitSensorSystem : EntitySystem
}
}
/// <summary>
/// Set all suit sensors on the equipment someone is wearing to the specified mode.
/// </summary>
public void SetAllSensors(EntityUid target, SuitSensorMode mode, SlotFlags slots = SlotFlags.All )
{
// iterate over all inventory slots
var slotEnumerator = _inventory.GetSlotEnumerator(target, slots);
while (slotEnumerator.NextItem(out var item, out _))
{
if (TryComp<SuitSensorComponent>(item, out var sensorComp))
SetSensor((item, sensorComp), mode);
}
}
public SuitSensorStatus? GetSensorState(EntityUid uid, SuitSensorComponent? sensor = null, TransformComponent? transform = null)
{
if (!Resolve(uid, ref sensor, ref transform))