Fix component constraints (#20241)

This commit is contained in:
metalgearsloth
2023-09-20 10:12:48 +10:00
committed by GitHub
parent d01a0e497d
commit 9f9577acd0
15 changed files with 19 additions and 19 deletions

View File

@@ -74,7 +74,7 @@ public sealed partial class ConstructionSystem
foreach (var entity in component.PartContainer.ContainedEntities)
{
if (TryComp<MachinePartComponent?>(entity, out var machinePart))
if (TryComp<MachinePartComponent>(entity, out var machinePart))
parts.Add(machinePart);
}
@@ -130,7 +130,7 @@ public sealed partial class ConstructionSystem
throw new Exception($"Couldn't insert board with prototype {component.BoardPrototype} to machine with prototype {MetaData(uid).EntityPrototype?.ID ?? "N/A"}!");
}
if (!TryComp<MachineBoardComponent?>(board, out var machineBoard))
if (!TryComp<MachineBoardComponent>(board, out var machineBoard))
{
throw new Exception($"Entity with prototype {component.BoardPrototype} doesn't have a {nameof(MachineBoardComponent)}!");
}