Merges two redundant procs.

This commit is contained in:
Zuhayr
2015-05-16 01:55:19 +09:30
parent 8611499e87
commit f021467f8b
3 changed files with 22 additions and 60 deletions

View File

@@ -19,13 +19,13 @@
set_species(new_species,1)
else
set_species()
if(species)
real_name = species.get_random_name(gender)
name = real_name
if(mind)
mind.name = real_name
hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100")
hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealthy")
hud_list[LIFE_HUD] = image('icons/mob/hud.dmi', src, "hudhealthy")
@@ -236,7 +236,7 @@
var/list/slot_ref = species.hud.gear[entry]
if((slot_ref["slot"] in list(slot_l_store, slot_r_store)))
continue
var/obj/item/thing_in_slot = get_item_in_slot(slot_ref["slot"])
var/obj/item/thing_in_slot = get_equipped_item(slot_ref["slot"])
dat += "<BR><B>[slot_ref["name"]]:</b> <a href='?src=\ref[src];item=[slot_ref["slot"]]'>[istype(thing_in_slot) ? thing_in_slot : "nothing"]</a>"
dat += "<BR><HR>"

View File

@@ -340,19 +340,23 @@ This saves us from having to call add_fingerprint() any time something is put in
/mob/living/carbon/human/get_equipped_item(var/slot)
switch(slot)
if(slot_wear_suit) return wear_suit
if(slot_gloves) return gloves
if(slot_shoes) return shoes
if(slot_belt) return belt
if(slot_glasses) return glasses
if(slot_head) return head
if(slot_l_ear) return l_ear
if(slot_r_ear) return r_ear
if(slot_w_uniform) return w_uniform
if(slot_wear_id) return wear_id
if(slot_l_store) return l_store
if(slot_r_store) return r_store
if(slot_s_store) return s_store
if(slot_back) return back
if(slot_legcuffed) return legcuffed
if(slot_handcuffed) return handcuffed
if(slot_legcuffed) return legcuffed
if(slot_l_store) return l_store
if(slot_r_store) return r_store
if(slot_wear_mask) return wear_mask
if(slot_l_hand) return l_hand
if(slot_r_hand) return r_hand
if(slot_wear_id) return wear_id
if(slot_glasses) return glasses
if(slot_gloves) return gloves
if(slot_head) return head
if(slot_shoes) return shoes
if(slot_belt) return belt
if(slot_wear_suit) return wear_suit
if(slot_w_uniform) return w_uniform
if(slot_s_store) return s_store
if(slot_l_ear) return l_ear
if(slot_r_ear) return r_ear
return ..()

View File

@@ -1,51 +1,9 @@
// I swear this proc already exists but I can't find it. ~ Z
/mob/living/carbon/human/proc/get_item_in_slot(var/slot_define)
switch(slot_define)
if(slot_back)
return back
if(slot_legcuffed)
return legcuffed
if(slot_handcuffed)
return handcuffed
if(slot_l_store)
return l_store
if(slot_r_store)
return r_store
if(slot_wear_mask)
return wear_mask
if(slot_l_hand)
return l_hand
if(slot_r_hand)
return r_hand
if(slot_wear_id)
return wear_id
if(slot_glasses)
return glasses
if(slot_gloves)
return gloves
if(slot_head)
return head
if(slot_shoes)
return shoes
if(slot_wear_suit)
return wear_suit
if(slot_w_uniform)
return w_uniform
if(slot_s_store)
return s_store
if(slot_l_ear)
return l_ear
if(slot_r_ear)
return r_ear
else
return null
/mob/living/carbon/human/proc/handle_strip(var/slot_to_strip,var/mob/living/user)
if(!slot_to_strip || !istype(user))
return
var/obj/item/target_slot = get_item_in_slot(text2num(slot_to_strip))
var/obj/item/target_slot = get_equipped_item(text2num(slot_to_strip))
switch(slot_to_strip)
// Handle things that are part of this interface but not removing/replacing a given item.