Enable nullability in Content.Server (#3685)

This commit is contained in:
DrSmugleaf
2021-03-16 15:50:20 +01:00
committed by GitHub
parent 90fec0ed24
commit a5ade526b7
306 changed files with 1616 additions and 1441 deletions

View File

@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using Robust.Shared.GameObjects;
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
@@ -16,12 +17,12 @@ namespace Content.Server.GameObjects.Components.GUI
/// <param name="flagsCheck">Whether the entity passes default slot masks & flags checks.</param>
/// <param name="reason">The translated reason why the item cannot be equiped, if this function returns false. Can be null.</param>
/// <returns>True if the entity can be equipped, false otherwise</returns>
bool CanEquip(Slots slot, IEntity entity, bool flagsCheck, out string reason)
bool CanEquip(Slots slot, IEntity entity, bool flagsCheck, [NotNullWhen(false)] out string? reason)
{
reason = null;
return flagsCheck;
}
bool CanEquip(Slots slot, IEntity entity, bool flagsCheck) => CanEquip(slot, entity, flagsCheck, out var _);
bool CanEquip(Slots slot, IEntity entity, bool flagsCheck) => CanEquip(slot, entity, flagsCheck, out _);
}
}