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 1 commit
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
Copy link
Contributor

@Drulikar Drulikar Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not correct that the changes here are returning the ID card. It just makes it so if say you have your ID in a wallet, the wallet will disappear because somereason you're having it directly search for the ID card:
id

Think of wear_id merely as the inventory SLOT. It was just merely incorrect before that things would assume the only thing that could be slotted was an ID card.

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_idcard())
var/obj/item/id_card = H.get_idcard()
id_card.screen_loc = ui_datum.hud_slot_offset(id_card, ui_datum.ui_id)
screenmob.client.add_to_screen(id_card)
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_idcard())
screenmob.client.remove_from_screen(H.get_idcard())
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_idcard() == 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_idcard())
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
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@

//gets ID card object from special clothes slot or null.
/mob/living/carbon/human/proc/get_idcard()
RETURN_TYPE(/obj/item)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be more correct as /obj/item/card/id

if(wear_id)
return wear_id.GetID()

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_idcard(), /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_idcard()
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_idcard()) qdel(zombie.get_idcard())
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