From 1d1b0daaa0725ccdca88c1bd50ded46a5b37f288 Mon Sep 17 00:00:00 2001
From: variableundefined <40092670+variableundefined@users.noreply.github.com>
Date: Thu, 27 Sep 2018 11:40:39 +0800
Subject: [PATCH] Fixes gearspawning for good
---
code/game/jobs/job_controller.dm | 68 +++++++++++++----------
code/modules/mob/new_player/new_player.dm | 3 +-
2 files changed, 39 insertions(+), 32 deletions(-)
diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm
index 0e315e03b2c..5f4483610d2 100644
--- a/code/game/jobs/job_controller.dm
+++ b/code/game/jobs/job_controller.dm
@@ -412,8 +412,45 @@ var/global/datum/controller/occupations/job_master
return 1
+/datum/controller/occupations/proc/AssignRank(var/mob/living/carbon/human/H, var/rank, var/joined_late = 0)
+ if(!H)
+ return null
+ var/datum/job/job = GetJob(rank)
-/datum/controller/occupations/proc/EquipRank(var/mob/living/carbon/human/H, var/rank, var/joined_late = 0)
+ H.job = rank
+
+ var/alt_title = null
+
+ if(H.mind)
+ H.mind.assigned_role = rank
+ alt_title = H.mind.role_alt_title
+
+ CreateMoneyAccount(H, rank, job)
+
+ to_chat(H, "You are the [alt_title ? alt_title : rank].")
+ to_chat(H, "As the [alt_title ? alt_title : rank] you answer directly to [job.supervisors]. Special circumstances may change this.")
+ to_chat(H, "For more information on how the station works, see Standard Operating Procedure (SOP)")
+ if(job.is_service)
+ to_chat(H, "As a member of Service, make sure to read up on your Department SOP")
+ if(job.is_supply)
+ to_chat(H, "As a member of Supply, make sure to read up on your Department SOP")
+ if(job.is_command)
+ to_chat(H, "As an important member of Command, read up on your Department SOP")
+ if(job.is_legal)
+ to_chat(H, "Your job requires complete knowledge of Space Law and Legal Standard Operating Procedure")
+ if(job.is_engineering)
+ to_chat(H, "As a member of Engineering, make sure to read up on your Department SOP")
+ if(job.is_medical)
+ to_chat(H, "As a member of Medbay, make sure to read up on your Department SOP")
+ if(job.is_science)
+ to_chat(H, "As a member of Science, make sure to read up on your Department SOP")
+ if(job.is_security)
+ to_chat(H, "As a member of Security, you are to know Space Law, Legal Standard Operating Procedure, as well as your Department SOP")
+ if(job.req_admin_notify)
+ to_chat(H, "You are playing a job that is important for the game progression. If you have to disconnect, please notify the admins via adminhelp.")
+
+ return H
+/datum/controller/occupations/proc/EquipRank(mob/living/carbon/human/H, rank, joined_late = 0) // Equip and put them in an area
if(!H)
return null
@@ -457,40 +494,11 @@ var/global/datum/controller/occupations/job_master
H.buckled.loc = H.loc
H.buckled.dir = H.dir
- var/alt_title = null
- if(H.mind)
- H.mind.assigned_role = rank
- alt_title = H.mind.role_alt_title
-
- CreateMoneyAccount(H, rank, job)
-
if(job)
var/new_mob = job.equip(H)
if(ismob(new_mob))
H = new_mob
- to_chat(H, "You are the [alt_title ? alt_title : rank].")
- to_chat(H, "As the [alt_title ? alt_title : rank] you answer directly to [job.supervisors]. Special circumstances may change this.")
- to_chat(H, "For more information on how the station works, see Standard Operating Procedure (SOP)")
- if(job.is_service)
- to_chat(H, "As a member of Service, make sure to read up on your Department SOP")
- if(job.is_supply)
- to_chat(H, "As a member of Supply, make sure to read up on your Department SOP")
- if(job.is_command)
- to_chat(H, "As an important member of Command, read up on your Department SOP")
- if(job.is_legal)
- to_chat(H, "Your job requires complete knowledge of Space Law and Legal Standard Operating Procedure")
- if(job.is_engineering)
- to_chat(H, "As a member of Engineering, make sure to read up on your Department SOP")
- if(job.is_medical)
- to_chat(H, "As a member of Medbay, make sure to read up on your Department SOP")
- if(job.is_science)
- to_chat(H, "As a member of Science, make sure to read up on your Department SOP")
- if(job.is_security)
- to_chat(H, "As a member of Security, you are to know Space Law, Legal Standard Operating Procedure, as well as your Department SOP")
- if(job.req_admin_notify)
- to_chat(H, "You are playing a job that is important for the game progression. If you have to disconnect, please notify the admins via adminhelp.")
-
if(job && H)
job.after_spawn(H)
diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm
index ad71a626180..97a0dc9ca80 100644
--- a/code/modules/mob/new_player/new_player.dm
+++ b/code/modules/mob/new_player/new_player.dm
@@ -316,11 +316,10 @@
job_master.AssignRole(src, rank, 1)
var/mob/living/character = create_character() //creates the human and transfers vars and mind
-
+ character = job_master.AssignRank(character, rank, 1) //equips the human
// AIs don't need a spawnpoint, they must spawn at an empty core
if(character.mind.assigned_role == "AI")
-
var/mob/living/silicon/ai/ai_character = character.AIize() // AIize the character, but don't move them yet
// IsJobAvailable for AI checks that there is an empty core available in this list