Skip to content

Commit

Permalink
Merge pull request #3301 from LenSkozzy/dev
Browse files Browse the repository at this point in the history
Fixes ID card object not being initialized due to mind.initial_account being set before the account is initialized
  • Loading branch information
MistakeNot4892 authored Sep 10, 2023
2 parents 8b0cfbe + 384f1f3 commit ffa6965
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 2 additions & 0 deletions code/controllers/subsystems/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ SUBSYSTEM_DEF(jobs)
job.apply_fingerprints(H)
spawn_in_storage = equip_custom_loadout(H, job)
job.setup_account(H)
var/decl/hierarchy/outfit/outfit = job.get_outfit(H, H.mind ? H.mind.role_alt_title : "", H.char_branch, H.char_rank)
outfit.equip_id(H, H.mind ? H.mind.role_alt_title : "", H.char_branch, H.char_rank)
else
to_chat(H, "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator.")

Expand Down
15 changes: 4 additions & 11 deletions code/datums/outfits/outfit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,14 @@ var/global/list/outfits_decls_by_type_
/decl/hierarchy/outfit/proc/equip(mob/living/carbon/human/H, var/rank, var/assignment, var/equip_adjustments)
equip_base(H, equip_adjustments)

rank = id_pda_assignment || rank
assignment = id_pda_assignment || assignment || rank
var/obj/item/card/id/W = equip_id(H, rank, assignment, equip_adjustments)
if(W)
rank = W.rank
assignment = W.assignment
equip_pda(H, rank, assignment, equip_adjustments)

for(var/path in backpack_contents)
var/number = backpack_contents[path]
for(var/i=0,i<number,i++)
H.equip_to_slot_or_store_or_drop(new path(H), slot_in_backpack_str)

if(!(OUTFIT_ADJUSTMENT_SKIP_POST_EQUIP & equip_adjustments))
post_equip(H)
H.update_icon()
if(W) // We set ID info last to ensure the ID photo is as correct as possible.
H.set_id_info(W)

return 1

/decl/hierarchy/outfit/proc/equip_base(mob/living/carbon/human/H, var/equip_adjustments)
Expand Down Expand Up @@ -191,10 +181,13 @@ var/global/list/outfits_decls_by_type_
W.rank = rank
if(assignment)
W.assignment = assignment
H.update_icon()
H.set_id_info(W)
equip_pda(H, rank, assignment, equip_adjustments)
if(H.equip_to_slot_or_store_or_drop(W, id_slot))
return W


/decl/hierarchy/outfit/proc/equip_pda(var/mob/living/carbon/human/H, var/rank, var/assignment, var/equip_adjustments)
if(!pda_slot || !pda_type)
return
Expand Down

0 comments on commit ffa6965

Please sign in to comment.