diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index fdc6b6650d1..d85c925096e 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -289,14 +289,22 @@ if(QDELETED(incoming_stack)) break if(!QDELETED(part)) //If we're a stack and we merged we might not exist anymore - components += part - part.forceMove(src) + var/stock_part_datum = GLOB.stock_part_datums_per_object[part.type] + if (!isnull(stock_part_datum)) + components += stock_part_datum + qdel(part) + else + components += part + part.forceMove(src) to_chat(user, span_notice("You add [part] to [src].")) if(added_components.len) replacer.play_rped_sound() return for(var/stock_part_base in req_components) + if (req_components[stock_part_base] == 0) + continue + var/stock_part_path if (ispath(stock_part_base, /obj/item)) @@ -308,9 +316,6 @@ stack_trace("Bad stock part in req_components: [stock_part_base]") continue - if (req_components[stock_part_path] == 0) - continue - if (!istype(P, stock_part_path)) continue