mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-22 12:46:40 +01:00
Null checks and tears
This commit is contained in:
@@ -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>"
|
||||
|
||||
Reference in New Issue
Block a user