Fix lobby ready names runtiming on assistant/no pref (#13474)

This commit is contained in:
Wildkins
2022-04-12 14:18:56 -04:00
committed by GitHub
parent 4b6b105e38
commit 90b00a04a9
3 changed files with 14 additions and 7 deletions
@@ -51,7 +51,8 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
for(var/mob/abstract/new_player/player in player_list)
totalPlayers++
if(player.ready)
stat("[copytext_char(player.client.prefs.real_name, 1, 18)]", ("[player.client.prefs.return_chosen_high_job(TRUE)]"))
var/job_ready = player.client.prefs.return_chosen_high_job(TRUE)
stat("[copytext_char(player.client.prefs.real_name, 1, 18)]", job_ready ? "[job_ready]" : "N/A")
totalPlayersReady++
/mob/abstract/new_player/Topic(href, href_list[])
@@ -200,10 +200,7 @@
// Determine what job is marked as 'High' priority, and dress them up as such.
var/datum/job/previewJob
if(job_civilian_low & ASSISTANT)
previewJob = SSjobs.GetJob("Assistant")
else
previewJob = return_chosen_high_job()
previewJob = return_chosen_high_job()
if(previewJob)
mannequin.job = previewJob.title
@@ -228,14 +225,17 @@
/datum/preferences/proc/return_chosen_high_job(var/title = FALSE)
var/datum/job/chosenJob
if(job_civilian_high)
if(job_civilian_low & ASSISTANT)
// Assistant is weird, has to be checked first because it overrides
chosenJob = SSjobs.bitflag_to_job["[SERVICE]"]["[job_civilian_low]"]
else if(job_civilian_high)
chosenJob = SSjobs.bitflag_to_job["[SERVICE]"]["[job_civilian_high]"]
else if(job_medsci_high)
chosenJob = SSjobs.bitflag_to_job["[MEDSCI]"]["[job_medsci_high]"]
else if(job_engsec_high)
chosenJob = SSjobs.bitflag_to_job["[ENGSEC]"]["[job_engsec_high]"]
if(title)
if(istype(chosenJob) && title)
return chosenJob.title
return chosenJob
+6
View File
@@ -0,0 +1,6 @@
author: JohnWildkins
delete-after: True
changes:
- bugfix: "Fixed lobby ready names causing errors if no high-priority role was selected, or if assistant was enabled."