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