Can only remove item from storage if active hand is free (#1255)

Co-authored-by: Bright0 <nsmoaksmoakna@gmail.com>
This commit is contained in:
Bright0
2020-07-02 15:37:10 -06:00
committed by GitHub
parent 0a8a383019
commit 6c205c4a79

View File

@@ -288,16 +288,16 @@ namespace Content.Server.GameObjects
var entity = _entityManager.GetEntity(remove.EntityUid);
if (entity != null && storage.Contains(entity))
{
Remove(entity);
var item = entity.GetComponent<ItemComponent>();
if (item != null && playerentity.TryGetComponent(out HandsComponent hands))
{
if (hands.PutInHand(item))
if (hands.CanPutInHand(item) && hands.PutInHand(item))
{
return;
}
}
entity.GetComponent<ITransformComponent>().WorldPosition = ourtransform.WorldPosition;
}
}
break;