From 0177f86d4c9c1f877558ff746b587aced870c812 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Tue, 19 May 2020 18:52:06 -0700 Subject: [PATCH] Fixes runtime in antagonist_helpers.dm, line 15: Cannot read null.mob_type (#7195) --- code/game/antagonist/antagonist_helpers.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/game/antagonist/antagonist_helpers.dm b/code/game/antagonist/antagonist_helpers.dm index 10f7a75b15..ebf212f065 100644 --- a/code/game/antagonist/antagonist_helpers.dm +++ b/code/game/antagonist/antagonist_helpers.dm @@ -12,8 +12,12 @@ return FALSE if(avoid_silicons) var/datum/job/J = SSjob.get_job(player.assigned_role) - if(J.mob_type & JOB_SILICON) - return FALSE + if(J) + if(J.mob_type & JOB_SILICON) + return FALSE + else // If SSjob couldn't find a job, they don't have one yet, so the next best thing we can switch on are job preferences + if((player.current.client.prefs.job_engsec_high | player.current.client.prefs.job_engsec_med | player.current.client.prefs.job_engsec_low) & (AI | CYBORG)) // If they have ANY chance of being silicon + return FALSE return TRUE /datum/antagonist/proc/antags_are_dead()