Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes worn_id a private var #6505

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions code/_onclick/hud/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@
if(H.s_store)
H.s_store.screen_loc = ui_datum.hud_slot_offset(H.s_store, ui_datum.ui_sstore1)
screenmob.client.add_to_screen(H.s_store)
if(H.wear_id)
H.wear_id.screen_loc = ui_datum.hud_slot_offset(H.wear_id, ui_datum.ui_id)
screenmob.client.add_to_screen(H.wear_id)
if(H.get_wear_id())
var/obj/item/id = H.get_wear_id()
id.screen_loc = ui_datum.hud_slot_offset(id, ui_datum.ui_id)
screenmob.client.add_to_screen(id)
if(H.belt)
H.belt.screen_loc = ui_datum.hud_slot_offset(H.belt, ui_datum.ui_belt)
screenmob.client.add_to_screen(H.belt)
Expand All @@ -211,8 +212,8 @@
else
if(H.s_store)
screenmob.client.remove_from_screen(H.s_store)
if(H.wear_id)
screenmob.client.remove_from_screen(H.wear_id)
if(H.get_wear_id())
screenmob.client.remove_from_screen(H.get_wear_id())
if(H.belt)
screenmob.client.remove_from_screen(H.belt)
if(H.back)
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if(ishuman(M))
var/mob/living/carbon/human/H = M
//if they are holding or wearing a card that has access, that works
if(check_access(H.get_active_hand()) || check_access(H.wear_id))
if(check_access(H.get_active_hand()) || check_access(H.get_idcard()))
return TRUE
return check_yautja_access(H)
if(istype(M, /mob/living/carbon/xenomorph))
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/ARES/ARES_interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
if(istype(idcard))
authentication = get_ares_access(idcard)
last_login = idcard.registered_name
else if(operator.wear_id)
else if(operator.get_idcard())
idcard = operator.get_idcard()
if(idcard)
authentication = get_ares_access(idcard)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/ARES/ARES_interface_apollo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
if(istype(idcard))
authentication = get_ares_access(idcard)
last_login = idcard.registered_name
else if(user.wear_id)
else if(user.get_idcard())
idcard = user.get_idcard()
if(idcard)
authentication = get_ares_access(idcard)
Expand Down Expand Up @@ -316,7 +316,7 @@
var/has_id = FALSE
if(istype(idcard))
has_id = TRUE
else if(user.wear_id)
else if(user.get_idcard())
idcard = user.get_idcard()
if(idcard)
has_id = TRUE
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/ARES/apollo_pda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
if(istype(idcard))
authentication = get_ares_access(idcard)
last_login = idcard.registered_name
else if(user.wear_id)
else if(user.get_idcard())
idcard = user.get_idcard()
if(idcard)
authentication = get_ares_access(idcard)
Expand Down Expand Up @@ -342,7 +342,7 @@
var/has_id = FALSE
if(istype(idcard))
has_id = TRUE
else if(user.wear_id)
else if(user.get_idcard())
idcard = user.get_idcard()
if(idcard)
has_id = TRUE
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/nuclearbomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ GLOBAL_VAR_INIT(bomb_set, FALSE)
//Check if they have command access
var/list/acc = list()
var/mob/living/carbon/human/H = ui.user
if(H.wear_id)
acc += H.wear_id.GetAccess()
if(H.get_idcard())
acc += H.get_idcard().GetAccess()
if(H.get_active_hand())
acc += H.get_active_hand().GetAccess()
if(!(ACCESS_MARINE_COMMAND in acc))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ cases. Override_icon_state should be a list.*/
return FALSE
return TRUE
if(WEAR_ID)
if(human.wear_id)
if(human.get_idcard())
return FALSE
if(!(flags_equip_slot & SLOT_ID))
return FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/radio/listening_bugs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
if(!ishuman(usr))
return
var/mob/living/carbon/human/user = usr
if(!check_access(user.wear_id) && !check_access(user.get_active_hand()))
if(!check_access(user.get_idcard()) && !check_access(user.get_active_hand()))
to_chat(user, SPAN_WARNING("You need an authenticated ID card to change this function!"))
return
if(subspace_switchable)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/cm_preds/yaut_bracers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1106,10 +1106,10 @@
to_chat(usr, SPAN_WARNING("You do not know how to use this."))
return

if(H.wear_id == embedded_id)
if(H.get_wear_id() == embedded_id)
to_chat(H, SPAN_NOTICE("You retract your ID chip."))
move_chip_to_bracer()
else if(H.wear_id)
else if(H.get_wear_id())
to_chat(H, SPAN_WARNING("Something is obstructing the deployment of your ID chip!"))
else
to_chat(H, SPAN_NOTICE("You expose your ID chip."))
Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,15 @@

//gets ID card object from special clothes slot or null.
/mob/living/carbon/human/proc/get_idcard()
RETURN_TYPE(/obj/item/card/id)
if(wear_id)
return wear_id.GetID()

/// Getter for human wear_id. Use get_idcard() if you ONLY want an ID card, not their wallet or whatever else they may have in the ID slot
/mob/living/carbon/human/proc/get_wear_id()
RETURN_TYPE(/obj/item)
return wear_id

//Removed the horrible safety parameter. It was only being used by ninja code anyways.
//Now checks siemens_coefficient of the affected area by default
/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, base_siemens_coeff = 1.0, def_zone = null)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
var/obj/item/head = null
var/obj/item/wear_l_ear = null
var/obj/item/wear_r_ear = null
var/obj/item/wear_id = null
VAR_PRIVATE/obj/item/wear_id = null
var/obj/item/r_store = null
var/obj/item/l_store = null
var/obj/item/s_store = null
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/human_stripping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.get_target_lock(user.faction_group))
to_chat(user, SPAN_WARNING("You can't strip a crit or dead member of another faction!"))
return
if(!istype(sourcemob.wear_id, /obj/item/card/id/dogtag))
if(!istype(sourcemob.get_wear_id(), /obj/item/card/id/dogtag))
return
if (!sourcemob.undefibbable && !skillcheck(user, SKILL_POLICE, SKILL_POLICE_SKILLED))
return
var/obj/item/card/id/dogtag/tag = sourcemob.wear_id
var/obj/item/card/id/dogtag/tag = sourcemob.get_wear_id()
if(tag.dogtag_taken)
to_chat(user, SPAN_WARNING("Someone's already taken [sourcemob]'s information tag."))
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/species/zombie.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

if(zombie.l_hand) zombie.drop_inv_item_on_ground(zombie.l_hand, FALSE, TRUE)
if(zombie.r_hand) zombie.drop_inv_item_on_ground(zombie.r_hand, FALSE, TRUE)
if(zombie.wear_id) qdel(zombie.wear_id)
if(zombie.get_wear_id()) qdel(zombie.get_wear_id())
if(zombie.gloves) zombie.drop_inv_item_on_ground(zombie.gloves, FALSE, TRUE)
if(zombie.head) zombie.drop_inv_item_on_ground(zombie.head, FALSE, TRUE)
if(zombie.glasses) zombie.drop_inv_item_on_ground(zombie.glasses, FALSE, TRUE)
Expand Down
Loading