Fix being able to store larger or the same size storage containers within another (#172)
This commit is contained in:
committed by
Pieter-Jan Briers
parent
e381920e86
commit
a73c76cd02
@@ -110,12 +110,19 @@ namespace Content.Server.GameObjects
|
|||||||
public bool CanInsert(IEntity toinsert)
|
public bool CanInsert(IEntity toinsert)
|
||||||
{
|
{
|
||||||
_ensureInitialCalculated();
|
_ensureInitialCalculated();
|
||||||
|
|
||||||
|
if (toinsert.TryGetComponent(out ServerStorageComponent storage))
|
||||||
|
{
|
||||||
|
if (storage.StorageCapacityMax >= StorageCapacityMax)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (toinsert.TryGetComponent(out StoreableComponent store))
|
if (toinsert.TryGetComponent(out StoreableComponent store))
|
||||||
{
|
{
|
||||||
if (store.ObjectSize <= (StorageCapacityMax - StorageUsed))
|
if (store.ObjectSize > (StorageCapacityMax - StorageUsed))
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user