Fix circuit cloning creating invisible clothing (#18435)

* Fix circuit cloning creating invisible clothing

* Minor fix
This commit is contained in:
Aura Dusklight
2025-09-10 00:51:40 +02:00
committed by GitHub
parent e4aaab74e6
commit 731db50eec
2 changed files with 10 additions and 0 deletions
@@ -299,6 +299,9 @@
var/restored_path = src.restore_assembly_prefix(assembly_data["t"])
var/original_path = text2path(restored_path)
if(original_path && ispath(original_path, /obj/item/electronic_assembly))
// Reject clothing assemblies
if(ispath(original_path, /obj/item/electronic_assembly/clothing))
return null
assembly = new original_path()
// Default to medium assembly
@@ -349,6 +349,13 @@
to_chat(user, span_warning("Invalid circuit format!"))
return
if(assembly_data["t"])
var/restored_path = src.restore_assembly_prefix(assembly_data["t"])
var/assembly_path = text2path(restored_path)
if(assembly_path && ispath(assembly_path, /obj/item/electronic_assembly/clothing))
to_chat(user, span_warning("Cannot import wearable electronic assemblies!"))
return
// Check if we have enough metal to build all components
var/total_cost = 0
var/total_complexity = 0