Skip to content

Commit

Permalink
Shuffling checks around.
Browse files Browse the repository at this point in the history
  • Loading branch information
Segrain committed Aug 2, 2023
1 parent 8471995 commit 7de7b94
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1943,30 +1943,29 @@ var/const/MAX_SAVE_SLOTS = 10


/// Loads appropriate character slot for the given job as assigned in preferences.
/datum/preferences/proc/find_assigned_slot(job_title, is_late_join = FALSE, check_datacore = FALSE)
/datum/preferences/proc/find_assigned_slot(job_title, is_late_join = FALSE)
if(toggle_prefs & (is_late_join ? TOGGLE_LATE_JOIN_CURRENT_SLOT : TOGGLE_START_JOIN_CURRENT_SLOT))
return
var/slot_for_job = pref_job_slots[job_title]
switch(slot_for_job)
if(JOB_SLOT_RANDOMISED_SLOT)
be_random_body = TRUE
be_random_name = TRUE
check_datacore = FALSE
if(1 to MAX_SAVE_SLOTS)
load_character(slot_for_job)
if(check_datacore)
for(var/datum/data/record/record as anything in GLOB.data_core.locked)
if(record.fields["name"] == real_name)
be_random_body = TRUE
be_random_name = TRUE
return

/// Transfers both physical characteristics and character information to character
/datum/preferences/proc/copy_all_to(mob/living/carbon/human/character, job_title, is_late_join = FALSE, check_datacore = FALSE)
if(!istype(character))
return

find_assigned_slot(job_title, is_late_join, check_datacore)
find_assigned_slot(job_title, is_late_join)
if(check_datacore && !(be_random_body && be_random_name))
for(var/datum/data/record/record as anything in GLOB.data_core.locked)
if(record.fields["name"] == real_name)
be_random_body = TRUE
be_random_name = TRUE
break

if(be_random_name)
real_name = random_name(gender)
Expand Down

0 comments on commit 7de7b94

Please sign in to comment.