mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge pull request #10117 from VOREStation/upstream-merge-8019
[MIRROR] Autolathes don't spam debug on first use
This commit is contained in:
committed by
Chompstation Bot
parent
3e7c6d7261
commit
aa8abda597
@@ -5,7 +5,7 @@
|
|||||||
I = new path()
|
I = new path()
|
||||||
|
|
||||||
if(!I) // Something has gone horribly wrong, or right.
|
if(!I) // Something has gone horribly wrong, or right.
|
||||||
log_debug("[name] created an Autolathe design without an assigned path. This is expected for only the Material Sheet generation.")
|
log_debug("[name] created an Autolathe design without an assigned path.")
|
||||||
return
|
return
|
||||||
|
|
||||||
if(I.matter && !resources)
|
if(I.matter && !resources)
|
||||||
@@ -80,22 +80,12 @@
|
|||||||
if(istype(M, /datum/material/alienalloy))
|
if(istype(M, /datum/material/alienalloy))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
var/obj/item/stack/material/Mat = new M.stack_type()
|
var/obj/item/stack/material/S = M.stack_type
|
||||||
|
if(initial(S.name) in items_by_name)
|
||||||
if(Mat.name in items_by_name)
|
|
||||||
qdel(Mat)
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
var/datum/category_item/autolathe/materials/WorkDat = new(src)
|
var/datum/category_item/autolathe/materials/WorkDat = new(src, M)
|
||||||
|
|
||||||
WorkDat.name = "[Mat.name]"
|
|
||||||
WorkDat.resources = Mat.matter.Copy()
|
|
||||||
WorkDat.is_stack = TRUE
|
|
||||||
WorkDat.no_scale = TRUE
|
|
||||||
WorkDat.max_stack = Mat.max_amount
|
|
||||||
WorkDat.path = M.stack_type
|
|
||||||
|
|
||||||
qdel(Mat)
|
|
||||||
|
|
||||||
items |= WorkDat
|
items |= WorkDat
|
||||||
items_by_name[WorkDat.name] = WorkDat
|
items_by_name[WorkDat.name] = WorkDat
|
||||||
|
|||||||
@@ -1,38 +1,23 @@
|
|||||||
|
/datum/category_item/autolathe/materials
|
||||||
/datum/category_item/autolathe/materials/metal
|
|
||||||
name = "steel sheets"
|
|
||||||
path =/obj/item/stack/material/steel
|
|
||||||
is_stack = TRUE
|
is_stack = TRUE
|
||||||
no_scale = TRUE //prevents material duplication exploits
|
no_scale = TRUE // Prevents material duplaction exploits
|
||||||
|
|
||||||
/datum/category_item/autolathe/materials/glass
|
/datum/category_item/autolathe/materials/New(var/loc, var/mat)
|
||||||
name = "glass sheets"
|
if(istype(mat, /obj/item/stack/material))
|
||||||
path =/obj/item/stack/material/glass
|
var/obj/item/stack/material/M = mat
|
||||||
is_stack = TRUE
|
name = M.name
|
||||||
no_scale = TRUE //prevents material duplication exploits
|
resources = M.matter.Copy()
|
||||||
|
max_stack = M.max_amount
|
||||||
|
path = M.type
|
||||||
|
else if(istype(mat, /datum/material))
|
||||||
|
var/datum/material/M = mat
|
||||||
|
var/obj/item/stack/material/S = M.stack_type
|
||||||
|
name = initial(S.name)
|
||||||
|
resources = M.get_matter()
|
||||||
|
max_stack = initial(S.max_amount)
|
||||||
|
path = S
|
||||||
|
. = ..()
|
||||||
|
|
||||||
/datum/category_item/autolathe/materials/rglass
|
/datum/category_item/autolathe/materials/rods // Not strictly a material, so they need their own define
|
||||||
name = "reinforced glass sheets"
|
|
||||||
path =/obj/item/stack/material/glass/reinforced
|
|
||||||
is_stack = TRUE
|
|
||||||
no_scale = TRUE //prevents material duplication exploits
|
|
||||||
|
|
||||||
/datum/category_item/autolathe/materials/rods
|
|
||||||
name = "metal rods"
|
name = "metal rods"
|
||||||
path =/obj/item/stack/rods
|
path =/obj/item/stack/rods
|
||||||
is_stack = TRUE
|
|
||||||
no_scale = TRUE //prevents material duplication exploits
|
|
||||||
|
|
||||||
/datum/category_item/autolathe/materials/plasteel
|
|
||||||
name = "plasteel sheets"
|
|
||||||
path =/obj/item/stack/material/plasteel
|
|
||||||
is_stack = TRUE
|
|
||||||
no_scale = TRUE //prevents material duplication exploits
|
|
||||||
resources = list(MAT_PLASTEEL = 2000)
|
|
||||||
|
|
||||||
/datum/category_item/autolathe/materials/plastic
|
|
||||||
name = "plastic sheets"
|
|
||||||
path =/obj/item/stack/material/plastic
|
|
||||||
is_stack = TRUE
|
|
||||||
no_scale = TRUE //prevents material duplication exploits
|
|
||||||
resources = list(MAT_PLASTIC = 2000)
|
|
||||||
@@ -53,9 +53,10 @@ var/list/name_to_material
|
|||||||
/proc/populate_material_list(force_remake=0)
|
/proc/populate_material_list(force_remake=0)
|
||||||
if(name_to_material && !force_remake) return // Already set up!
|
if(name_to_material && !force_remake) return // Already set up!
|
||||||
name_to_material = list()
|
name_to_material = list()
|
||||||
for(var/type in typesof(/datum/material) - /datum/material)
|
for(var/type in subtypesof(/datum/material))
|
||||||
var/datum/material/new_mineral = new type
|
var/datum/material/new_mineral = new type
|
||||||
if(!new_mineral.name)
|
if(!new_mineral.name)
|
||||||
|
qdel(new_mineral)
|
||||||
continue
|
continue
|
||||||
name_to_material[lowertext(new_mineral.name)] = new_mineral
|
name_to_material[lowertext(new_mineral.name)] = new_mineral
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user