mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-22 04:24:20 +01:00
Fixes Improper usages of Accessory Procs (#18350)
* everyday I lose more brain cells * better fix * implementing requested changes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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, "<span class='warning'>You need a jumpsuit before you can attach this [I.name].</span>")
|
||||
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, "<span class='warning'>You already have an accessory of this type attached to your [uniform].</span>")
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user