Enable nullability in Content.Client (#3257)

* Enable nullability in Content.Client

* Remove #nullable enable

* Merge fixes

* Remove Debug.Assert

* Merge fixes

* Fix build

* Fix build
This commit is contained in:
DrSmugleaf
2021-03-10 14:48:29 +01:00
committed by GitHub
parent 4f9bd4e802
commit 902aa128c2
270 changed files with 1774 additions and 1550 deletions

View File

@@ -38,7 +38,7 @@ namespace Content.Client.State
private IEventBus _eventBus => _entityManager.EventBus;
private IEntity _lastHoveredEntity;
private IEntity? _lastHoveredEntity;
private bool _outlineEnabled = true;
@@ -79,7 +79,7 @@ namespace Content.Client.State
inRange = localPlayer.InRangeUnobstructed(entityToClick, ignoreInsideBlocker: true);
}
InteractionOutlineComponent outline;
InteractionOutlineComponent? outline;
if(!_outlineEnabled || !ConfigurationManager.GetCVar(CCVars.OutlineEnabled))
{
if(entityToClick != null && entityToClick.TryGetComponent(out outline))
@@ -113,7 +113,7 @@ namespace Content.Client.State
}
}
public IEntity GetEntityUnderPosition(MapCoordinates coordinates)
public IEntity? GetEntityUnderPosition(MapCoordinates coordinates)
{
var entitiesUnderPosition = GetEntitiesUnderPosition(coordinates);
return entitiesUnderPosition.Count > 0 ? entitiesUnderPosition[0] : null;
@@ -226,7 +226,7 @@ namespace Content.Client.State
entityToClick?.Uid ?? EntityUid.Invalid);
// client side command handlers will always be sent the local player session.
var session = PlayerManager.LocalPlayer.Session;
var session = PlayerManager.LocalPlayer?.Session;
if (inputSys.HandleInputCommand(session, func, message))
{
args.Handle();