diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 6a8a6fd228a..82c46884d1c 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -677,6 +677,12 @@ BLIND // can't see anything QDEL_LIST(accessories) return ..() +/* + * # can_attach_accessory + * + * Arguments: + * * A - The accessory object being checked. MUST BE TYPE /obj/item/clothing/accessory +*/ /obj/item/clothing/under/proc/can_attach_accessory(obj/item/clothing/accessory/A) if(length(accessories) >= MAX_EQUIPABLE_ACCESSORIES) //this is neccesary to prevent chat spam when examining clothing return FALSE diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 68c24b0242c..8221fd2d7ec 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -785,12 +785,14 @@ return TRUE return FALSE if(slot_tie) - if(!H.w_uniform) + if(!istype(I, /obj/item/clothing/accessory)) + return FALSE + var/obj/item/clothing/under/uniform = H.w_uniform + if(!uniform) if(!disable_warning) to_chat(H, "You need a jumpsuit before you can attach this [I.name].") return FALSE - var/obj/item/clothing/under/uniform = H.w_uniform - if(uniform.accessories.len && !uniform.can_attach_accessory(H)) + if(length(uniform.accessories) && !uniform.can_attach_accessory(I)) if(!disable_warning) to_chat(H, "You already have an accessory of this type attached to your [uniform].") return FALSE