diff --git a/Content.Client/Construction/ConstructionPlacementHijack.cs b/Content.Client/Construction/ConstructionPlacementHijack.cs index e84f3949fe..ed5003e8e9 100644 --- a/Content.Client/Construction/ConstructionPlacementHijack.cs +++ b/Content.Client/Construction/ConstructionPlacementHijack.cs @@ -1,4 +1,5 @@ -using Content.Client.GameObjects.Components.Construction; +#nullable enable +using Content.Client.GameObjects.Components.Construction; using Content.Client.GameObjects.EntitySystems; using Content.Shared.Construction; using Robust.Client.Placement; @@ -11,15 +12,15 @@ namespace Content.Client.Construction public sealed class ConstructionPlacementHijack : PlacementHijack { private readonly ConstructionSystem _constructionSystem; - private readonly ConstructionPrototype _prototype; + private readonly ConstructionPrototype? _prototype; public override bool CanRotate { get; } - public ConstructionPlacementHijack(ConstructionSystem constructionSystem, ConstructionPrototype prototype) + public ConstructionPlacementHijack(ConstructionSystem constructionSystem, ConstructionPrototype? prototype) { _constructionSystem = constructionSystem; _prototype = prototype; - CanRotate = prototype.CanRotate; + CanRotate = prototype?.CanRotate ?? true; } /// @@ -36,7 +37,7 @@ namespace Content.Client.Construction /// public override bool HijackDeletion(IEntity entity) { - if (entity.TryGetComponent(out ConstructionGhostComponent ghost)) + if (entity.TryGetComponent(out ConstructionGhostComponent? ghost)) { _constructionSystem.ClearGhost(ghost.GhostID); } @@ -48,7 +49,7 @@ namespace Content.Client.Construction { base.StartHijack(manager); - manager.CurrentBaseSprite = _prototype.Icon.DirFrame0(); + manager.CurrentBaseSprite = _prototype?.Icon.DirFrame0(); } } }