diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 49575cd3f7..f50af33481 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -195,7 +195,7 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid). reagents.remove_reagent(C, D.chemicals[C] * mat_efficiency) if(D.build_path) - var/obj/new_item = new D.build_path(src) + var/obj/new_item = D.Fabricate(src) new_item.loc = loc if(mat_efficiency != 1) // No matter out of nowhere if(new_item.matter && new_item.matter.len > 0) diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index ce5fb4670b..a85788d161 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -55,6 +55,11 @@ other types of metals and chemistry for reagents). desc = "Allows for the construction of \a [item_name]." return +//Returns a new instance of the item for this design +//This is to allow additional initialization to be performed, including possibly additional contructor arguments. +/datum/design/proc/Fabricate(var/newloc) + return new build_path(newloc) + /datum/design/item build_type = PROTOLATHE @@ -212,6 +217,11 @@ other types of metals and chemistry for reagents). var/obj/item/weapon/cell/C = build_path desc = "Allows the construction of power cells that can hold [initial(C.maxcharge)] units of energy." +/datum/design/item/powercell/Fabricate() + var/obj/item/weapon/cell/C = ..() + C.charge = 0 //shouldn't produce power out of thin air. + return C + /datum/design/item/powercell/basic name = "basic" build_type = PROTOLATHE | MECHFAB diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 9cb029f58e..843e7f6dd5 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -196,7 +196,7 @@ reagents.remove_reagent(C, D.chemicals[C] * mat_efficiency) if(D.build_path) - var/obj/new_item = new D.build_path(src) + var/obj/new_item = D.Fabricate(src) new_item.loc = loc if(mat_efficiency != 1) // No matter out of nowhere if(new_item.matter && new_item.matter.len > 0)