Nullability fixes.
This commit is contained in:
@@ -60,7 +60,7 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
||||
{
|
||||
_state = value;
|
||||
|
||||
if (!Owner.TryGetComponent(out AppearanceComponent appearance))
|
||||
if (!Owner.TryGetComponent(out AppearanceComponent? appearance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Owner.TryGetComponent(out PowerReceiverComponent receiver) &&
|
||||
if (Owner.TryGetComponent(out PowerReceiverComponent? receiver) &&
|
||||
!receiver.Powered)
|
||||
{
|
||||
return false;
|
||||
@@ -114,7 +114,7 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!entity.TryGetComponent(out ICollidableComponent collidable) ||
|
||||
if (!entity.TryGetComponent(out ICollidableComponent? collidable) ||
|
||||
collidable.Anchored)
|
||||
{
|
||||
return false;
|
||||
@@ -155,7 +155,7 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entity.TryGetComponent(out ICollidableComponent collidable))
|
||||
if (entity.TryGetComponent(out ICollidableComponent? collidable))
|
||||
{
|
||||
var controller = collidable.EnsureController<ConveyedController>();
|
||||
controller.Move(direction, _speed * frameTime);
|
||||
@@ -225,7 +225,7 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!@switch.TryGetComponent(out ConveyorSwitchComponent component))
|
||||
if (!@switch.TryGetComponent(out ConveyorSwitchComponent? component))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -247,13 +247,13 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
||||
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Using.TryGetComponent(out ConveyorSwitchComponent conveyorSwitch))
|
||||
if (eventArgs.Using.TryGetComponent(out ConveyorSwitchComponent? conveyorSwitch))
|
||||
{
|
||||
conveyorSwitch.Connect(this, eventArgs.User);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (eventArgs.Using.TryGetComponent(out ToolComponent tool))
|
||||
if (eventArgs.Using.TryGetComponent(out ToolComponent? tool))
|
||||
{
|
||||
return await ToolUsed(eventArgs.User, tool);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
||||
{
|
||||
_state = value;
|
||||
|
||||
if (Owner.TryGetComponent(out AppearanceComponent appearance))
|
||||
if (Owner.TryGetComponent(out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(ConveyorVisuals.State, value);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!conveyor.TryGetComponent(out ConveyorComponent component))
|
||||
if (!conveyor.TryGetComponent(out ConveyorComponent? component))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -172,7 +172,7 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!@switch.TryGetComponent(out ConveyorSwitchComponent component))
|
||||
if (!@switch.TryGetComponent(out ConveyorSwitchComponent? component))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -196,13 +196,13 @@ namespace Content.Server.GameObjects.Components.Conveyor
|
||||
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Using.TryGetComponent(out ConveyorComponent conveyor))
|
||||
if (eventArgs.Using.TryGetComponent(out ConveyorComponent? conveyor))
|
||||
{
|
||||
Connect(conveyor, eventArgs.User);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (eventArgs.Using.TryGetComponent(out ConveyorSwitchComponent otherSwitch))
|
||||
if (eventArgs.Using.TryGetComponent(out ConveyorSwitchComponent? otherSwitch))
|
||||
{
|
||||
SyncWith(otherSwitch, eventArgs.User);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user