Reordered item insertion checks (#11822)
This commit is contained in:
@@ -522,17 +522,9 @@ namespace Content.Server.Storage.EntitySystems
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TryComp(insertEnt, out ServerStorageComponent? storage) &&
|
||||
storage.StorageCapacityMax >= storageComp.StorageCapacityMax)
|
||||
if (TryComp(insertEnt, out TransformComponent? transformComp) && transformComp.Anchored)
|
||||
{
|
||||
reason = "comp-storage-insufficient-capacity";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TryComp(insertEnt, out ItemComponent? itemComp) &&
|
||||
itemComp.Size > storageComp.StorageCapacityMax - storageComp.StorageUsed)
|
||||
{
|
||||
reason = "comp-storage-insufficient-capacity";
|
||||
reason = "comp-storage-anchored-failure";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -548,9 +540,17 @@ namespace Content.Server.Storage.EntitySystems
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TryComp(insertEnt, out TransformComponent? transformComp) && transformComp.Anchored)
|
||||
if (TryComp(insertEnt, out ServerStorageComponent? storage) &&
|
||||
storage.StorageCapacityMax >= storageComp.StorageCapacityMax)
|
||||
{
|
||||
reason = "comp-storage-anchored-failure";
|
||||
reason = "comp-storage-insufficient-capacity";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TryComp(insertEnt, out ItemComponent? itemComp) &&
|
||||
itemComp.Size > storageComp.StorageCapacityMax - storageComp.StorageUsed)
|
||||
{
|
||||
reason = "comp-storage-insufficient-capacity";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user