Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
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
18 changes: 10 additions & 8 deletions code/datums/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@
dat = replacetext(dat, "\t", "")
return dat

/datum/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C)
/datum/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C, force = FALSE, use_real_name = TRUE)
set waitfor = FALSE
var/static/list/show_directions = list(SOUTH, WEST)
if(H.mind && (H.mind.assigned_role != H.mind.special_role))
if(H.mind && (H.mind.assigned_role != H.mind.special_role) || force)
var/assignment
if(H.mind.role_alt_title)
assignment = H.mind.role_alt_title
Expand All @@ -300,6 +300,8 @@
else
assignment = "Unassigned"

var/record_name = use_real_name ? H.real_name : H.name

var/static/record_id_num = 1001
var/id = num2hex(record_id_num++,6)
if(!C)
Expand All @@ -320,7 +322,7 @@
//General Record
var/datum/data/record/G = new()
G.fields["id"] = id
G.fields["name"] = H.real_name
G.fields["name"] = record_name
G.fields["rank"] = assignment
G.fields["age"] = H.age
G.fields["species"] = H.dna.species.name
Expand All @@ -341,7 +343,7 @@
//Medical Record
var/datum/data/record/M = new()
M.fields["id"] = id
M.fields["name"] = H.real_name
M.fields["name"] = record_name
M.fields["blood_type"] = H.dna.blood_type
M.fields["b_dna"] = H.dna.unique_enzymes
M.fields["mi_dis"] = "None"
Expand All @@ -358,7 +360,7 @@
//Security Record
var/datum/data/record/S = new()
S.fields["id"] = id
S.fields["name"] = H.real_name
S.fields["name"] = record_name
S.fields["criminal"] = "None"
S.fields["citation"] = list()
S.fields["crimes"] = list()
Expand All @@ -368,9 +370,9 @@

//Locked Record
var/datum/data/record/L = new()
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") //surely this should just be id, like the others?
L.fields["name"] = H.real_name
L.fields["rank"] = H.mind.assigned_role
L.fields["id"] = md5("[record_name][assignment]") //surely this should just be id, like the others?
L.fields["name"] = record_name
L.fields["rank"] = assignment
L.fields["age"] = H.age
L.fields["gender"] = H.gender
if(H.gender == "male")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ GLOBAL_VAR_INIT(next_button_push, 0)
if(alert(user, "Are you sure you want your crew manifest entry to be [H.real_name], [ID.assignment]?", "", "Yes", "No") == "Yes")
var/list/all_jobs = (GLOB.command_positions + GLOB.engineering_positions + GLOB.medical_positions + GLOB.science_positions + GLOB.supply_positions + GLOB.civilian_positions + GLOB.security_positions)
if((ID.assignment in all_jobs) || (alert(user, "Are you sure you want your job to be '[ID.assignment]'? This is not a default job, and may look strange on the manifest!", "", "Yes", "No") == "Yes"))
GLOB.data_core.manifest_inject(H, H.client, ID.assignment)
H.mind.role_alt_title = ID.assignment
GLOB.data_core.manifest_inject(H, force = TRUE, use_real_name = FALSE)
to_chat(user, span_notice("Added to manifest."))
do_sparks(2, FALSE, src)
qdel(src)
Expand Down