Null checks and tears

This commit is contained in:
Anewbe
2018-02-25 02:25:06 -06:00
parent bbd870e502
commit 0b8dfae30b
2 changed files with 4 additions and 6 deletions
@@ -1,11 +1,9 @@
/obj/item/clothing/proc/can_attach_accessory(obj/item/clothing/accessory/A)
var/obj/item/clothing/accessory/attach = A
if(src.valid_accessory_slots && (attach.slot in src.valid_accessory_slots))
if(accessories.len && restricted_accessory_slots && (attach.slot in restricted_accessory_slots))
if(src.valid_accessory_slots && (A.slot in src.valid_accessory_slots))
if(accessories.len && restricted_accessory_slots && (A.slot in restricted_accessory_slots))
for(var/obj/item/clothing/accessory/AC in accessories)
if (AC.slot == attach.slot)
if (AC.slot == A.slot)
return FALSE
return TRUE
return TRUE
else
return FALSE
@@ -319,7 +319,7 @@ This saves us from having to call add_fingerprint() any time something is put in
for(var/obj/item/clothing/C in worn_clothing)
if(istype(W, /obj/item/clothing/accessory))
var/obj/item/clothing/accessory/A = W
if(C.attempt_attach_accessory(A))
if(C.attempt_attach_accessory(A, src))
return
else
src << "<font color='red'>You are trying to equip this item to an unsupported inventory slot. How the heck did you manage that? Stop it...</font>"