From f378dfa3506515c0f3345da0761b46e63a07eb58 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 29 Aug 2013 00:03:16 -0700 Subject: [PATCH] Species type check for clothing adjustment. --- code/modules/clothing/clothing.dm | 26 ++++++++++++++------ code/modules/clothing/under/jobs/security.dm | 1 - 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 4c1ed6a1dc3..b7321cbada6 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -4,16 +4,28 @@ //BS12: Species-restricted clothing check. /obj/item/clothing/mob_can_equip(M as mob, slot) + if(species_restricted && istype(M,/mob/living/carbon/human)) + var/wearable = null + var/exclusive = null var/mob/living/carbon/human/H = M - for(var/str in species_restricted) - if(H.species && H.species.name == str) - wearable = 1 - break - if(!wearable) - M << "\red Your species cannot wear [src]." - return 0 + + if("exclude" in species_restricted) + exclusive = 1 + + if(H.species) + if(exclusive) + if(!(H.species.name in species_restricted)) + wearable = 1 + else + if(H.species.name in species_restricted) + wearable = 1 + + if(!wearable) + M << "\red Your species cannot wear [src]." + return 0 + return ..() //Ears: currently only used for headsets and earmuffs diff --git a/code/modules/clothing/under/jobs/security.dm b/code/modules/clothing/under/jobs/security.dm index ed972361967..9de05b4a875 100644 --- a/code/modules/clothing/under/jobs/security.dm +++ b/code/modules/clothing/under/jobs/security.dm @@ -108,7 +108,6 @@ flags_inv = HIDEEARS siemens_coefficient = 0.8 - /obj/item/clothing/suit/armor/hos name = "armored coat" desc = "A greatcoat enhanced with a special alloy for some protection and style."