diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index c5840eaed29..2e8429edd3a 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -382,14 +382,14 @@ var/list/global/slot_flags_enumeration = list(
if(!allow)
return 0
if(slot_tie)
- if(!H.w_uniform && (slot_w_uniform in mob_equip))
+ var/allow = 0
+ for(var/obj/item/clothing/C in H.worn_clothing) //Runs through everything you're wearing, returns if you can't attach the thing
+ if(C.can_attach_accessory(src))
+ allow = 1
+ break
+ if(!allow)
if(!disable_warning)
- H << "You need a jumpsuit before you can attach this [name]."
- return 0
- var/obj/item/clothing/under/uniform = H.w_uniform
- if(uniform.accessories.len && !uniform.can_attach_accessory(src))
- if (!disable_warning)
- H << "You already have an accessory of this type attached to your [uniform]."
+ H << "You're not wearing anything you can attach this [name] to."
return 0
return 1
diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm
index 0fa70c68ca8..f60d1822403 100644
--- a/code/modules/clothing/clothing_accessories.dm
+++ b/code/modules/clothing/clothing_accessories.dm
@@ -1,28 +1,36 @@
/obj/item/clothing/proc/can_attach_accessory(obj/item/clothing/accessory/A)
if(valid_accessory_slots && istype(A) && (A.slot in valid_accessory_slots))
- .=1
- else
- return 0
+ if(accessories.len && restricted_accessory_slots && (A.slot in restricted_accessory_slots))
+ for(var/obj/item/clothing/accessory/AC in accessories)
+ if (AC.slot == A.slot)
+ return 0
+ return 1
+ return 0
+
if(accessories.len && restricted_accessory_slots && (A.slot in restricted_accessory_slots))
for(var/obj/item/clothing/accessory/AC in accessories)
if (AC.slot == A.slot)
return 0
+ return 1
/obj/item/clothing/attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/clothing/accessory))
if(!valid_accessory_slots || !valid_accessory_slots.len)
usr << "You cannot attach accessories of any kind to \the [src]."
+ world << "clothing/attackby !valid"
+ user.drop_item()
return
var/obj/item/clothing/accessory/A = I
if(can_attach_accessory(A))
user.drop_item()
attach_accessory(user, A)
+ world << "clothing/attackby success"
return
else
user << "You cannot attach more accessories of this type to [src]."
- return
+ return
if(accessories.len)
for(var/obj/item/clothing/accessory/A in accessories)
@@ -37,8 +45,10 @@
for(var/obj/item/clothing/accessory/A in accessories)
A.attack_hand(user)
return
- if ((ishuman(usr) || issmall(usr)) && src.loc == user)
- return
+ if (ishuman(user) && src.loc == user)
+ var/mob/living/carbon/human/H = user
+ if(src != H.l_store && src != H.r_store && src != H.s_store)
+ return
return ..()
/obj/item/clothing/MouseDrop(var/obj/over_object)
diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm
index 5d18858cc35..0e50beff993 100644
--- a/code/modules/clothing/under/accessories/accessory.dm
+++ b/code/modules/clothing/under/accessories/accessory.dm
@@ -59,6 +59,7 @@
//when user attached an accessory to S
/obj/item/clothing/accessory/proc/on_attached(var/obj/item/clothing/S, var/mob/user)
+ world << "on_attached"
if(!istype(S))
return
has_suit = S
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index b82da139915..b7682669a8b 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -155,6 +155,7 @@
//head
if(head && head.show_examine)
+ world << "[head.show_examine]"
if(head.blood_DNA)
msg += "[T.He] [T.is] wearing \icon[head] [head.gender==PLURAL?"some":"a"] [(head.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [head.name] on [T.his] head!\n"
else
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index 5c269c7ce21..871145d8a9d 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -3,6 +3,9 @@ Add fingerprints to items when we put them in our hands.
This saves us from having to call add_fingerprint() any time something is put in a human's hands programmatically.
*/
+/mob/living/carbon/human
+ var/list/worn_clothing = list() //Contains all CLOTHING items worn
+
/mob/living/carbon/human/verb/quick_equip()
set name = "quick-equip"
set hidden = 1
@@ -86,6 +89,7 @@ This saves us from having to call add_fingerprint() any time something is put in
if (W == wear_suit)
if(s_store)
drop_from_inventory(s_store)
+ worn_clothing -= wear_suit
wear_suit = null
update_inv_wear_suit()
else if (W == w_uniform)
@@ -96,16 +100,21 @@ This saves us from having to call add_fingerprint() any time something is put in
if (wear_id)
drop_from_inventory(wear_id)
if (belt)
+ worn_clothing -= belt
drop_from_inventory(belt)
+ worn_clothing -= w_uniform
w_uniform = null
update_inv_w_uniform()
else if (W == gloves)
+ worn_clothing -= gloves
gloves = null
update_inv_gloves()
else if (W == glasses)
+ worn_clothing -= glasses
glasses = null
update_inv_glasses()
else if (W == head)
+ worn_clothing -= head
head = null
if(istype(W, /obj/item))
var/obj/item/I = W
@@ -121,12 +130,15 @@ This saves us from having to call add_fingerprint() any time something is put in
r_ear = null
update_inv_ears()
else if (W == shoes)
+ worn_clothing -= shoes
shoes = null
update_inv_shoes()
else if (W == belt)
+ worn_clothing -= belt
belt = null
update_inv_belt()
else if (W == wear_mask)
+ worn_clothing -= wear_mask
wear_mask = null
if(istype(W, /obj/item))
var/obj/item/I = W
@@ -187,15 +199,21 @@ This saves us from having to call add_fingerprint() any time something is put in
//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc.
/mob/living/carbon/human/equip_to_slot(obj/item/W as obj, slot, redraw_mob = 1)
- if(!slot) return
- if(!istype(W)) return
- if(!has_organ_for_slot(slot)) return
- if(!species || !species.hud || !(slot in species.hud.equip_slots)) return
+ if(!slot)
+ return
+ if(!istype(W))
+ return
+ if(!has_organ_for_slot(slot))
+ return
+ if(!species || !species.hud || !(slot in species.hud.equip_slots))
+ return
+
W.loc = src
switch(slot)
if(slot_back)
src.back = W
W.equipped(src, slot)
+ worn_clothing += back
update_inv_back(redraw_mob)
if(slot_wear_mask)
src.wear_mask = W
@@ -203,6 +221,7 @@ This saves us from having to call add_fingerprint() any time something is put in
update_hair(redraw_mob) //rebuild hair
update_inv_ears(0)
W.equipped(src, slot)
+ worn_clothing += wear_mask
update_inv_wear_mask(redraw_mob)
if(slot_handcuffed)
src.handcuffed = W
@@ -222,6 +241,7 @@ This saves us from having to call add_fingerprint() any time something is put in
if(slot_belt)
src.belt = W
W.equipped(src, slot)
+ worn_clothing += belt
update_inv_belt(redraw_mob)
if(slot_wear_id)
src.wear_id = W
@@ -252,6 +272,7 @@ This saves us from having to call add_fingerprint() any time something is put in
if(slot_gloves)
src.gloves = W
W.equipped(src, slot)
+ worn_clothing += glasses
update_inv_gloves(redraw_mob)
if(slot_head)
src.head = W
@@ -262,18 +283,22 @@ This saves us from having to call add_fingerprint() any time something is put in
if(istype(W,/obj/item/clothing/head/kitty))
W.update_icon(src)
W.equipped(src, slot)
+ worn_clothing += head
update_inv_head(redraw_mob)
if(slot_shoes)
src.shoes = W
W.equipped(src, slot)
+ worn_clothing += shoes
update_inv_shoes(redraw_mob)
if(slot_wear_suit)
src.wear_suit = W
W.equipped(src, slot)
+ worn_clothing += wear_suit
update_inv_wear_suit(redraw_mob)
if(slot_w_uniform)
src.w_uniform = W
W.equipped(src, slot)
+ worn_clothing += w_uniform
update_inv_w_uniform(redraw_mob)
if(slot_l_store)
src.l_store = W
@@ -292,8 +317,8 @@ This saves us from having to call add_fingerprint() any time something is put in
src.remove_from_mob(W)
W.loc = src.back
if(slot_tie)
- var/obj/item/clothing/under/uniform = src.w_uniform
- uniform.attackby(W,src)
+ for(var/obj/item/clothing/C in worn_clothing)
+ C.attackby(W, usr)
else
src << "You are trying to eqip this item to an unsupported inventory slot. How the heck did you manage that? Stop it..."
return