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

@@ -76,11 +76,6 @@ namespace Content.Server.GameObjects.Components.GUI
public override bool Drop(DragDropEventArgs args)
{
if (args.User == null)
{
return false;
}
if (!args.User.TryGetComponent(out IActorComponent? actor)) return false;
OpenUserInterface(actor.playerSession);
@@ -288,7 +283,7 @@ namespace Content.Server.GameObjects.Components.GUI
if (!inventory.HasSlot(slot))
return false;
if (!inventory.TryGetSlotItem(slot, out ItemComponent itemToTake))
if (!inventory.TryGetSlotItem(slot, out ItemComponent? itemToTake))
{
user.PopupMessageCursor(Loc.GetString("{0:They} {0:have} nothing there!", Owner));
return false;
@@ -319,7 +314,12 @@ namespace Content.Server.GameObjects.Components.GUI
var item = inventory.GetSlotItem(slot);
inventory.Unequip(slot, false);
userHands.PutInHandOrDrop(item);
if (item != null)
{
userHands.PutInHandOrDrop(item);
}
UpdateSubscribed();
}