Nullability fixes.
This commit is contained in:
@@ -101,13 +101,13 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
{
|
||||
EnsureInitialCalculated();
|
||||
|
||||
if (entity.TryGetComponent(out ServerStorageComponent storage) &&
|
||||
if (entity.TryGetComponent(out ServerStorageComponent? storage) &&
|
||||
storage._storageCapacityMax >= _storageCapacityMax)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entity.TryGetComponent(out StorableComponent store) &&
|
||||
if (entity.TryGetComponent(out StorableComponent? store) &&
|
||||
store.ObjectSize > _storageCapacityMax - _storageUsed)
|
||||
{
|
||||
return false;
|
||||
@@ -164,7 +164,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
|
||||
Logger.DebugS(LoggerName, $"Storage (UID {Owner.Uid}) had entity (UID {message.Entity.Uid}) removed from it.");
|
||||
|
||||
if (!message.Entity.TryGetComponent(out StorableComponent storable))
|
||||
if (!message.Entity.TryGetComponent(out StorableComponent? storable))
|
||||
{
|
||||
Logger.WarningS(LoggerName, $"Removed entity {message.Entity.Uid} without a StorableComponent from storage {Owner.Uid} at {Owner.Transform.MapPosition}");
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
{
|
||||
EnsureInitialCalculated();
|
||||
|
||||
if (!player.TryGetComponent(out IHandsComponent hands) ||
|
||||
if (!player.TryGetComponent(out IHandsComponent? hands) ||
|
||||
hands.GetActiveHand == null)
|
||||
{
|
||||
return false;
|
||||
@@ -317,7 +317,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
|
||||
private void UpdateDoorState()
|
||||
{
|
||||
if (Owner.TryGetComponent(out AppearanceComponent appearance))
|
||||
if (Owner.TryGetComponent(out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(StorageVisuals.Open, SubscribedSessions.Count != 0);
|
||||
}
|
||||
@@ -382,7 +382,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
|
||||
var item = entity.GetComponent<ItemComponent>();
|
||||
if (item == null ||
|
||||
!player.TryGetComponent(out HandsComponent hands))
|
||||
!player.TryGetComponent(out HandsComponent? hands))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -506,7 +506,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
|
||||
bool IDragDrop.CanDragDrop(DragDropEventArgs eventArgs)
|
||||
{
|
||||
return eventArgs.Target.TryGetComponent(out PlaceableSurfaceComponent placeable) &&
|
||||
return eventArgs.Target.TryGetComponent(out PlaceableSurfaceComponent? placeable) &&
|
||||
placeable.IsPlaceable;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user