Make more uids nullable (#5794)

This commit is contained in:
Leon Friedrich
2021-12-26 15:32:45 +13:00
committed by GitHub
parent 83114de0e4
commit afc3ae6335
42 changed files with 161 additions and 204 deletions

View File

@@ -27,7 +27,7 @@ namespace Content.Server.Storage.EntitySystems
return;
var alreadySpawnedGroups = new List<string>();
EntityUid entityToPlaceInHands = default;
EntityUid? entityToPlaceInHands = null;
foreach (var storageItem in component.Items)
{
if (!string.IsNullOrEmpty(storageItem.GroupId) &&
@@ -57,10 +57,10 @@ namespace Content.Server.Storage.EntitySystems
EntityManager.DeleteEntity(uid);
}
if (entityToPlaceInHands != default
if (entityToPlaceInHands != null
&& EntityManager.TryGetComponent<SharedHandsComponent?>(args.User, out var hands))
{
hands.TryPutInAnyHand(entityToPlaceInHands);
hands.TryPutInAnyHand(entityToPlaceInHands.Value);
}
}
}