Merge pull request #14565 from Heroman3003/atuolaathe

Fixes hull-made items putting hull materials in my autolathe
This commit is contained in:
Heroman3003
2023-02-26 19:45:45 +10:00
committed by CHOMPStation2
parent e966a01446
commit 7717c49c87
2 changed files with 13 additions and 2 deletions

View File

@@ -65,6 +65,17 @@ var/list/name_to_material
. = list()
for(var/mat in matter)
var/datum/material/M = GET_MATERIAL_REF(mat)
if(M.composite_material && M.composite_material.len)
for(var/submat in M.composite_material)
var/datum/material/SM = GET_MATERIAL_REF(submat)
if(SM in .)
.[SM] += matter[mat]*(M.composite_material[submat]/SHEET_MATERIAL_AMOUNT)
else
.[SM] = matter[mat]*(M.composite_material[submat]/SHEET_MATERIAL_AMOUNT)
else
if(M in .)
.[M] += matter[mat]
else
.[M] = matter[mat]
// Builds the datum list above.