Fix machine frames not taking material sheets correctly

This commit is contained in:
Vera Aguilera Puerto
2021-03-04 16:15:40 +01:00
parent 3c06fd39a4
commit 3ebfc897eb
2 changed files with 9 additions and 2 deletions

View File

@@ -258,13 +258,16 @@ namespace Content.Server.GameObjects.Components.Construction
var needed = MaterialRequirements[type] - _materialProgress[type];
var count = stack.Count;
if (count < needed && stack.Split(count, Owner.Transform.Coordinates, out var newStack))
if (count < needed)
{
if(!_partContainer.Insert(stack.Owner))
return false;
_materialProgress[type] += count;
return true;
}
if (!stack.Split(needed, Owner.Transform.Coordinates, out newStack))
if (!stack.Split(needed, Owner.Transform.Coordinates, out var newStack))
return false;
if(!_partContainer.Insert(newStack))

View File

@@ -0,0 +1,4 @@
author: Zumorica
changes:
- type: Fix
message: Fixed machine frames not correctly taking material sheets.