From c96d14cea29a5c8efec9e2433ee9db91133eab6d Mon Sep 17 00:00:00 2001
From: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>
Date: Sat, 17 Dec 2022 12:10:46 -0500
Subject: [PATCH] Fixes a runtime with ERTs and Money Accounts (#19802)
* runtime fix
* Update code/controllers/subsystem/jobs.dm
Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
---
code/controllers/subsystem/jobs.dm | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/code/controllers/subsystem/jobs.dm b/code/controllers/subsystem/jobs.dm
index eaf01d53019..bce263ec795 100644
--- a/code/controllers/subsystem/jobs.dm
+++ b/code/controllers/subsystem/jobs.dm
@@ -589,6 +589,12 @@ SUBSYSTEM_DEF(jobs)
H.mind.store_memory(remembered_info)
H.mind.set_initial_account(account)
+ to_chat(H, "As an employee of Nanotrasen you will receive a paycheck of $[account.payday_amount] credits every 30 minutes")
+ to_chat(H, "Your account number is: [account.account_number], your account pin is: [account.account_pin]")
+
+ if(!job) //if their job datum is null (looking at you ERTs...), we don't need to do anything past this point
+ return
+
//add them to their department datum, (this relates a lot to money account I promise)
var/list/users_departments = get_departments_from_job(job.title)
for(var/datum/station_department/department as anything in users_departments)
@@ -599,11 +605,8 @@ SUBSYSTEM_DEF(jobs)
member.can_approve_crates = job?.department_account_access
department.members += member
- to_chat(H, "As an employee of Nanotrasen you will receive a paycheck of $[account.payday_amount] credits every 30 minutes")
- to_chat(H, "Your account number is: [account.account_number], your account pin is: [account.account_pin]")
-
// If they're head, give them the account info for their department
- if(!job?.department_account_access)
+ if(!job.department_account_access)
return
announce_department_accounts(users_departments, H, job)