Enable nullability in Content.Server (#3685)
This commit is contained in:
@@ -12,14 +12,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
public class SignalLinkerSystem : EntitySystem
|
||||
{
|
||||
private Dictionary<NetUserId, SignalTransmitterComponent> _transmitters;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
_transmitters = new Dictionary<NetUserId, SignalTransmitterComponent>();
|
||||
}
|
||||
private readonly Dictionary<NetUserId, SignalTransmitterComponent?> _transmitters = new();
|
||||
|
||||
public bool SignalLinkerKeybind(NetUserId id, bool? enable)
|
||||
{
|
||||
@@ -35,7 +28,9 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
if (_transmitters.Count == 0)
|
||||
{
|
||||
CommandBinds.Builder
|
||||
.BindBefore(EngineKeyFunctions.Use, new PointerInputCmdHandler(HandleUse), typeof(InteractionSystem))
|
||||
.BindBefore(EngineKeyFunctions.Use,
|
||||
new PointerInputCmdHandler(HandleUse),
|
||||
typeof(InteractionSystem))
|
||||
.Register<SignalLinkerSystem>();
|
||||
}
|
||||
|
||||
@@ -59,8 +54,13 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
return enable.Value;
|
||||
}
|
||||
|
||||
private bool HandleUse(ICommonSession session, EntityCoordinates coords, EntityUid uid)
|
||||
private bool HandleUse(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
||||
{
|
||||
if (session?.AttachedEntity == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!_transmitters.TryGetValue(session.UserId, out var signalTransmitter))
|
||||
{
|
||||
return false;
|
||||
@@ -88,6 +88,5 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user