fix infinite lathe printing bug (#12343)

This commit is contained in:
Nemanja
2022-11-01 19:05:00 -04:00
committed by GitHub
parent 9d8f19a442
commit 6fd083af0b
6 changed files with 24 additions and 7 deletions

View File

@@ -50,7 +50,11 @@ public abstract class SharedLatheSystem : EntitySystem
foreach (var (material, needed) in recipe.RequiredMaterials)
{
if (_materialStorage.GetMaterialAmount(component.Owner, material) < amount * needed * component.MaterialUseMultiplier)
var adjustedAmount = recipe.ApplyMaterialDiscount
? (int) (amount * component.MaterialUseMultiplier)
: amount;
if (_materialStorage.GetMaterialAmount(component.Owner, material) < adjustedAmount * needed)
return false;
}
return true;