Fix component constraints (#20241)
This commit is contained in:
@@ -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)}!");
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user