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)}!");
}

View File

@@ -75,7 +75,7 @@ public sealed class MachineFrameSystem : EntitySystem
}
// Handle stacks
if (TryComp<StackComponent?>(args.Used, out var stack))
if (TryComp<StackComponent>(args.Used, out var stack))
{
if (TryInsertStack(uid, args.Used, component, stack))
args.Handled = true;
@@ -150,7 +150,7 @@ public sealed class MachineFrameSystem : EntitySystem
/// <returns>Whether or not the function had any effect. Does not indicate success.</returns>
private bool TryInsertBoard(EntityUid uid, EntityUid used, MachineFrameComponent component)
{
if (!TryComp<MachineBoardComponent?>(used, out var machineBoard))
if (!TryComp<MachineBoardComponent>(used, out var machineBoard))
return false;
if (!_container.TryRemoveFromContainer(used))

View File

@@ -44,7 +44,7 @@ namespace Content.Server.Construction
// TODO: If something has a stack... Just use a prototype with a single thing in the stack.
// This is not a good way to do it.
if (TryComp<StackComponent?>(droppedEnt, out var stack))
if (TryComp<StackComponent>(droppedEnt, out var stack))
_stackSystem.SetCount(droppedEnt, 1, stack);
}
}