From 37edab7b9a962cdd7d66ece602c2e99ffe7eafb6 Mon Sep 17 00:00:00 2001 From: Jordie <4343468+Jordie0608@users.noreply.github.com> Date: Fri, 26 Apr 2019 02:13:48 +1000 Subject: [PATCH] db connection checks for player age and job exp (#43667) --- code/modules/jobs/job_exp.dm | 2 ++ code/modules/jobs/job_types/_job.dm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/jobs/job_exp.dm b/code/modules/jobs/job_exp.dm index 4b7b1752409..f99bf650715 100644 --- a/code/modules/jobs/job_exp.dm +++ b/code/modules/jobs/job_exp.dm @@ -8,6 +8,8 @@ GLOBAL_PROTECT(exp_to_update) return 0 if(!CONFIG_GET(flag/use_exp_tracking)) return 0 + if(!SSdbcore.Connect()) + return 0 if(!exp_requirements || !exp_type) return 0 if(!job_is_xp_locked(src.title)) diff --git a/code/modules/jobs/job_types/_job.dm b/code/modules/jobs/job_types/_job.dm index 87373bacb0d..16f8148dd5f 100644 --- a/code/modules/jobs/job_types/_job.dm +++ b/code/modules/jobs/job_types/_job.dm @@ -139,8 +139,8 @@ return 0 if(!CONFIG_GET(flag/use_age_restriction_for_jobs)) return 0 - if(!isnum(C.player_age)) - return 0 //This is only a number if the db connection is established, otherwise it is text: "Requires database", meaning these restrictions cannot be enforced + if(!SSdbcore.Connect()) + return 0 //Without a database connection we can't get a player's age so we'll assume they're old enough for all jobs if(!isnum(minimal_player_age)) return 0