Enable nullability in Content.Shared (#3626)

* Enable nullability in Content.Shared

* Fix null errors in server

* aye github i swear on me mom
This commit is contained in:
DrSmugleaf
2021-03-15 21:55:49 +01:00
committed by GitHub
parent 04201e944c
commit 6f012cb9ad
31 changed files with 167 additions and 117 deletions

View File

@@ -21,8 +21,6 @@ using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Players;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
@@ -139,20 +137,24 @@ namespace Content.Server.GameObjects.Components.Interactable
{
if (!WelderLit)
{
if(!silent) Owner.PopupMessage(user, Loc.GetString("The welder is turned off!"));
if (!silent && user != null)
Owner.PopupMessage(user, Loc.GetString("The welder is turned off!"));
return false;
}
if (!CanWeld(value))
{
if(!silent) Owner.PopupMessage(user, Loc.GetString("The welder does not have enough fuel for that!"));
if (!silent && user != null)
Owner.PopupMessage(user, Loc.GetString("The welder does not have enough fuel for that!"));
return false;
}
if (_solutionComponent == null)
return false;
bool succeeded = _solutionComponent.TryRemoveReagent("chem.WeldingFuel", ReagentUnit.New(value));
var succeeded = _solutionComponent.TryRemoveReagent("chem.WeldingFuel", ReagentUnit.New(value));
if (succeeded && !silent)
{
@@ -192,7 +194,7 @@ namespace Content.Server.GameObjects.Components.Interactable
return true;
}
if (!CanLitWelder())
if (!CanLitWelder() && user != null)
{
Owner.PopupMessage(user, Loc.GetString("The welder has no fuel left!"));
return false;