slot_equipment_priority no longer contributes to list init overhead

This commit is contained in:
c0
2016-06-18 05:09:15 +03:00
parent 1311fb9b43
commit 0abc91c59d
3 changed files with 25 additions and 18 deletions
+1 -17
View File
@@ -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
+14 -1
View File
@@ -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
@@ -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))