diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index c1380146069..c9eb1afd810 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -59,7 +59,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s var/needs_permit = 0 //Used by security bots to determine if this item is safe for public use. var/list/attack_verb = list() //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" - var/list/species_exception = list() // even if a species cannot put items in a certain slot, if the species id is in the item's exception list, it will be able to wear that item + var/list/species_exception = null // list() of species types, if a species cannot put items in a certain slot, but species type is in list, it will be able to wear that item var/suittoggled = 0 var/hooded = 0 @@ -88,23 +88,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s var/hit_reaction_chance = 0 //If you want to have something unrelated to blocking/armour piercing etc. Maybe not needed, but trying to think ahead/allow more freedom //The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot. - var/list/slot_equipment_priority = list( \ - slot_back,\ - slot_wear_id,\ - slot_w_uniform,\ - slot_wear_suit,\ - slot_wear_mask,\ - slot_head,\ - slot_shoes,\ - slot_gloves,\ - slot_ears,\ - slot_glasses,\ - slot_belt,\ - slot_s_store,\ - slot_l_store,\ - slot_r_store,\ - slot_drone_storage\ - ) + var/list/slot_equipment_priority = null // for default list, see /mob/proc/equip_to_appropriate_slot() // Needs to be in /obj/item because corgis can wear a lot of // non-clothing items diff --git a/code/modules/clothing/gloves/boxing.dm b/code/modules/clothing/gloves/boxing.dm index 367abe770af..7c887ed7181 100644 --- a/code/modules/clothing/gloves/boxing.dm +++ b/code/modules/clothing/gloves/boxing.dm @@ -4,7 +4,7 @@ icon_state = "boxing" item_state = "boxing" put_on_delay = 60 - species_exception = list(/datum/species/golem, /datum/species/golem/adamantine) // now you too can be a golem boxing champion + species_exception = list(/datum/species/golem) // now you too can be a golem boxing champion /obj/item/clothing/gloves/boxing/green icon_state = "boxinggreen" diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 64d9cf2f1e8..9edf2d1c3ab 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -491,7 +491,7 @@ /datum/species/proc/can_equip(obj/item/I, slot, disable_warning, mob/living/carbon/human/H) if(slot in no_equip) - if(!(type in I.species_exception)) + if(!I.species_exception || !is_type_in_list(src, I.species_exception)) return 0 var/R = H.has_right_hand() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 49fdc9e6ed0..65595ed560c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -231,8 +231,21 @@ var/next_mob_id = 0 //returns 0 if it cannot, 1 if successful /mob/proc/equip_to_appropriate_slot(obj/item/W) if(!istype(W)) return 0 + var/slot_priority = W.slot_equipment_priority - for(var/slot in W.slot_equipment_priority) + if(!slot_priority) + slot_priority = list( \ + slot_back, slot_wear_id,\ + slot_w_uniform, slot_wear_suit,\ + slot_wear_mask, slot_head,\ + slot_shoes, slot_gloves,\ + slot_ears, slot_glasses,\ + slot_belt, slot_s_store,\ + slot_l_store, slot_r_store,\ + slot_drone_storage\ + ) + + for(var/slot in slot_priority) if(equip_to_slot_if_possible(W, slot, 0, 1, 1)) //qdel_on_fail = 0; disable_warning = 1; redraw_mob = 1 return 1 diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index ea340562dab..ed2793afb02 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -228,6 +228,16 @@ flags_inv = HIDEHAIR slot_flags = SLOT_HEAD armor = list(melee = 10, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) //Weak melee protection, because you can wear it on your head + slot_equipment_priority = list( \ + slot_back, slot_wear_id,\ + slot_w_uniform, slot_wear_suit,\ + slot_wear_mask, slot_head,\ + slot_shoes, slot_gloves,\ + slot_ears, slot_glasses,\ + slot_belt, slot_s_store,\ + slot_l_store, slot_r_store,\ + slot_drone_storage + ) /obj/item/weapon/reagent_containers/glass/bucket/attackby(obj/O, mob/user, params) if(istype(O, /obj/item/weapon/mop))