diff --git a/code/datums/station_traits/job_traits.dm b/code/datums/station_traits/job_traits.dm index 8dea2f96bbf..68b04b7922f 100644 --- a/code/datums/station_traits/job_traits.dm +++ b/code/datums/station_traits/job_traits.dm @@ -60,21 +60,18 @@ for (var/mob/dead/new_player/signee as anything in lobby_candidates) if (isnull(signee) || !signee.client || !signee.mind || signee.ready != PLAYER_READY_TO_PLAY) LAZYREMOVE(lobby_candidates, signee) - if (!LAZYLEN(lobby_candidates)) - on_failed_assignment() - return // Nobody signed up :( - for(var/_ in 1 to position_amount) + + var/datum/job/our_job = SSjob.GetJobType(job_to_add) + while(length(lobby_candidates) && position_amount > 0) var/mob/dead/new_player/picked_player = pick_n_take(lobby_candidates) - picked_player.mind.assigned_role = new job_to_add() - lobby_candidates = null + picked_player.mind.set_assigned_role(our_job) + position_amount-- -/// Called if we didn't assign a role before the round began, we add it to the latejoin menu instead -/datum/station_trait/job/proc/on_failed_assignment() - var/datum/job/our_job = SSjob.GetJob(job_to_add::title) - our_job.total_positions = position_amount + our_job.total_positions = max(0, position_amount) + lobby_candidates = null /datum/station_trait/job/can_display_lobby_button(client/player) - var/datum/job/our_job = SSjob.GetJob(job_to_add::title) + var/datum/job/our_job = SSjob.GetJobType(job_to_add) return our_job.player_old_enough(player) && ..() /// Adds a gorilla to the cargo department, replacing the sloth and the mech diff --git a/code/game/machinery/computer/accounting.dm b/code/game/machinery/computer/accounting.dm index 475bf404c1c..d804b8efe5d 100644 --- a/code/game/machinery/computer/accounting.dm +++ b/code/game/machinery/computer/accounting.dm @@ -21,10 +21,9 @@ for(var/current_account as anything in SSeconomy.bank_accounts_by_id) var/datum/bank_account/current_bank_account = SSeconomy.bank_accounts_by_id[current_account] - var/job_title = current_bank_account.account_job?.title player_accounts += list(list( "name" = current_bank_account.account_holder, - "job" = job_title ? job_title : "No Job", // because this can be null + "job" = current_bank_account.account_job?.title || "No job", // because this can be null "balance" = round(current_bank_account.account_balance), "modifier" = round((current_bank_account.payday_modifier * 0.9), 0.1), )) @@ -32,4 +31,3 @@ data["AuditLog"] = audit_list data["Crashing"] = HAS_TRAIT(SSeconomy, TRAIT_MARKET_CRASHING) return data - diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index c572980bf6d..fc57cc83c19 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -125,9 +125,8 @@ /obj/item/card/id/Initialize(mapload) . = ..() - var/datum/bank_account/blank_bank_account = new /datum/bank_account("Unassigned", player_account = FALSE) + var/datum/bank_account/blank_bank_account = new("Unassigned", SSjob.GetJobType(/datum/job/unassigned), player_account = FALSE) registered_account = blank_bank_account - blank_bank_account.account_job = new /datum/job/unassigned registered_account.replaceable = TRUE // Applying the trim updates the label and icon, so don't do this twice. @@ -1234,7 +1233,7 @@ /obj/item/card/id/advanced/debug/Initialize(mapload) . = ..() registered_account = SSeconomy.get_dep_account(ACCOUNT_CAR) - registered_account.account_job = new /datum/job/admin // so we can actually use this account without being filtered as a "departmental" card + registered_account.account_job = SSjob.GetJobType(/datum/job/admin) // so we can actually use this account without being filtered as a "departmental" card /obj/item/card/id/advanced/prisoner name = "prisoner ID card"