Enable nullability in Content.Server (#3685)
This commit is contained in:
@@ -6,6 +6,7 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
using static Content.Shared.GameObjects.Components.Doors.SharedDoorComponent;
|
||||
|
||||
namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
@@ -17,15 +18,15 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
public async Task<bool> Condition(IEntity entity)
|
||||
{
|
||||
if (!entity.TryGetComponent(out ServerDoorComponent doorComponent)) return false;
|
||||
if (!entity.TryGetComponent(out ServerDoorComponent? doorComponent)) return false;
|
||||
return doorComponent.IsWeldedShut == Welded;
|
||||
}
|
||||
|
||||
public bool DoExamine(IEntity entity, FormattedMessage message, bool inDetailsRange)
|
||||
{
|
||||
if (!entity.TryGetComponent(out ServerDoorComponent doorComponent)) return false;
|
||||
if (!entity.TryGetComponent(out ServerDoorComponent? doorComponent)) return false;
|
||||
|
||||
if (doorComponent.State == ServerDoorComponent.DoorState.Closed && Welded)
|
||||
if (doorComponent.State == DoorState.Closed && Welded)
|
||||
{
|
||||
message.AddMarkup(Loc.GetString("First, weld the door.\n"));
|
||||
return true;
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
using Content.Shared.Construction;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Construction.Conditions
|
||||
@@ -17,14 +16,14 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
public async Task<bool> Condition(IEntity entity)
|
||||
{
|
||||
if (!entity.TryGetComponent(out IPhysBody physics)) return false;
|
||||
if (!entity.TryGetComponent(out IPhysBody? physics)) return false;
|
||||
|
||||
return (physics.BodyType == BodyType.Static && Anchored) || (physics.BodyType != BodyType.Static && !Anchored);
|
||||
}
|
||||
|
||||
public bool DoExamine(IEntity entity, FormattedMessage message, bool inDetailsRange)
|
||||
{
|
||||
if (!entity.TryGetComponent(out IPhysBody physics)) return false;
|
||||
if (!entity.TryGetComponent(out IPhysBody? physics)) return false;
|
||||
|
||||
switch (Anchored)
|
||||
{
|
||||
|
||||
@@ -17,14 +17,14 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
public async Task<bool> Condition(IEntity entity)
|
||||
{
|
||||
if (!entity.TryGetComponent(out WiresComponent wires)) return false;
|
||||
if (!entity.TryGetComponent(out WiresComponent? wires)) return false;
|
||||
|
||||
return wires.IsPanelOpen == Open;
|
||||
}
|
||||
|
||||
public bool DoExamine(IEntity entity, FormattedMessage message, bool inDetailsRange)
|
||||
{
|
||||
if (!entity.TryGetComponent(out WiresComponent wires)) return false;
|
||||
if (!entity.TryGetComponent(out WiresComponent? wires)) return false;
|
||||
|
||||
switch (Open)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user