From 469e9a8c7f796fd6b94a902d1ed34c8bef4205e6 Mon Sep 17 00:00:00 2001 From: Mark Suckerberg Date: Tue, 4 Jul 2023 23:43:43 -0500 Subject: [PATCH] Kills off SSjob, changes suit sensor ordering --- code/__DEFINES/jobs.dm | 82 +++++++------- code/__HELPERS/global_lists.dm | 5 + code/_globalvars/lists/jobs.dm | 3 + code/controllers/subsystem/job.dm | 100 ------------------ code/controllers/subsystem/mapping.dm | 3 +- code/controllers/subsystem/overmap.dm | 43 ++++++++ code/datums/world_topic.dm | 2 +- code/game/atoms.dm | 5 + code/game/machinery/computer/crew.dm | 79 ++------------ code/game/objects/items/devices/PDA/PDA.dm | 2 +- code/game/objects/items/devices/PDA/cart.dm | 2 +- .../objects/structures/beds_chairs/chair.dm | 9 +- code/modules/clothing/chameleon.dm | 2 +- code/modules/jobs/job_exp.dm | 4 +- code/modules/jobs/job_report.dm | 2 +- code/modules/jobs/job_types/_job.dm | 12 ++- code/modules/mob/dead/crew_manifest.dm | 2 +- .../living/simple_animal/hostile/zombie.dm | 2 +- shiptest.dme | 2 +- 19 files changed, 136 insertions(+), 225 deletions(-) create mode 100644 code/_globalvars/lists/jobs.dm delete mode 100644 code/controllers/subsystem/job.dm diff --git a/code/__DEFINES/jobs.dm b/code/__DEFINES/jobs.dm index 2b2a20df8e9fc..21eb9b40e0669 100644 --- a/code/__DEFINES/jobs.dm +++ b/code/__DEFINES/jobs.dm @@ -8,40 +8,50 @@ #define DEFAULT_RELIGION "Christianity" #define DEFAULT_DEITY "Space Jesus" -#define JOB_DISPLAY_ORDER_DEFAULT 0 - -#define JOB_DISPLAY_ORDER_ASSISTANT 1 -#define JOB_DISPLAY_ORDER_CAPTAIN 2 -#define JOB_DISPLAY_ORDER_HEAD_OF_PERSONNEL 3 -#define JOB_DISPLAY_ORDER_QUARTERMASTER 4 -#define JOB_DISPLAY_ORDER_CARGO_TECHNICIAN 5 -#define JOB_DISPLAY_ORDER_SHAFT_MINER 6 -#define JOB_DISPLAY_ORDER_BARTENDER 7 -#define JOB_DISPLAY_ORDER_COOK 8 -#define JOB_DISPLAY_ORDER_BOTANIST 9 -#define JOB_DISPLAY_ORDER_JANITOR 10 -#define JOB_DISPLAY_ORDER_CLOWN 11 -#define JOB_DISPLAY_ORDER_MIME 12 -#define JOB_DISPLAY_ORDER_CURATOR 13 -#define JOB_DISPLAY_ORDER_LAWYER 14 -#define JOB_DISPLAY_ORDER_CHAPLAIN 15 -#define JOB_DISPLAY_ORDER_AI 16 -#define JOB_DISPLAY_ORDER_CYBORG 17 -#define JOB_DISPLAY_ORDER_CHIEF_ENGINEER 18 -#define JOB_DISPLAY_ORDER_STATION_ENGINEER 19 -#define JOB_DISPLAY_ORDER_ATMOSPHERIC_TECHNICIAN 20 -#define JOB_DISPLAY_ORDER_CHIEF_MEDICAL_OFFICER 21 -#define JOB_DISPLAY_ORDER_MEDICAL_DOCTOR 22 +#define JOB_DISPLAY_ORDER_CAPTAIN 0 +#define JOB_DISPLAY_ORDER_HEAD_OF_PERSONNEL 1 +#define JOB_DISPLAY_ORDER_SOLGOV 2 + +#define JOB_DISPLAY_ORDER_HEAD_OF_SECURITY 10 +#define JOB_DISPLAY_ORDER_WARDEN 11 +#define JOB_DISPLAY_ORDER_DETECTIVE 12 +#define JOB_DISPLAY_ORDER_SECURITY_OFFICER 13 +#define JOB_DISPLAY_ORDER_BRIG_PHYS 14 + +#define JOB_DISPLAY_ORDER_CHIEF_MEDICAL_OFFICER 20 +#define JOB_DISPLAY_ORDER_CHEMIST 21 +#define JOB_DISPLAY_ORDER_VIROLOGIST 22 #define JOB_DISPLAY_ORDER_PARAMEDIC 23 -#define JOB_DISPLAY_ORDER_CHEMIST 24 -#define JOB_DISPLAY_ORDER_VIROLOGIST 25 -#define JOB_DISPLAY_ORDER_PSYCHOLOGIST 26 -#define JOB_DISPLAY_ORDER_RESEARCH_DIRECTOR 27 -#define JOB_DISPLAY_ORDER_SCIENTIST 28 -#define JOB_DISPLAY_ORDER_ROBOTICIST 29 -#define JOB_DISPLAY_ORDER_GENETICIST 30 -#define JOB_DISPLAY_ORDER_HEAD_OF_SECURITY 31 -#define JOB_DISPLAY_ORDER_WARDEN 32 -#define JOB_DISPLAY_ORDER_DETECTIVE 33 -#define JOB_DISPLAY_ORDER_SECURITY_OFFICER 34 -#define JOB_DISPLAY_ORDER_PRISONER 35 +#define JOB_DISPLAY_ORDER_MEDICAL_DOCTOR 24 +#define JOB_DISPLAY_ORDER_PSYCHOLOGIST 25 + +#define JOB_DISPLAY_ORDER_RESEARCH_DIRECTOR 30 +#define JOB_DISPLAY_ORDER_SCIENTIST 31 +#define JOB_DISPLAY_ORDER_ROBOTICIST 32 +#define JOB_DISPLAY_ORDER_GENETICIST 33 + +#define JOB_DISPLAY_ORDER_CHIEF_ENGINEER 40 +#define JOB_DISPLAY_ORDER_STATION_ENGINEER 41 +#define JOB_DISPLAY_ORDER_ATMOSPHERIC_TECHNICIAN 42 + +#define JOB_DISPLAY_ORDER_QUARTERMASTER 50 +#define JOB_DISPLAY_ORDER_CARGO_TECHNICIAN 51 +#define JOB_DISPLAY_ORDER_SHAFT_MINER 52 + +#define JOB_DISPLAY_ORDER_BARTENDER 60 +#define JOB_DISPLAY_ORDER_COOK 61 +#define JOB_DISPLAY_ORDER_BOTANIST 62 +#define JOB_DISPLAY_ORDER_JANITOR 63 +#define JOB_DISPLAY_ORDER_CLOWN 64 +#define JOB_DISPLAY_ORDER_MIME 65 +#define JOB_DISPLAY_ORDER_CURATOR 66 +#define JOB_DISPLAY_ORDER_LAWYER 67 +#define JOB_DISPLAY_ORDER_CHAPLAIN 68 +#define JOB_DISPLAY_ORDER_AI 69 +#define JOB_DISPLAY_ORDER_CYBORG 70 + +#define JOB_DISPLAY_ORDER_PRISONER 75 + +#define JOB_DISPLAY_ORDER_DEFAULT 80 + +#define JOB_DISPLAY_ORDER_ASSISTANT 999 diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index e31076b6bc23c..4f9e234b0d27b 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -81,6 +81,11 @@ GLOB.materials_list[D.id] = D sortList(GLOB.materials_list, /proc/cmp_typepaths_asc) + //Default Jobs + for(var/path in subtypesof(/datum/job)) + var/datum/job/new_job = new path() + new_job.register() + // Keybindings init_keybindings() diff --git a/code/_globalvars/lists/jobs.dm b/code/_globalvars/lists/jobs.dm new file mode 100644 index 0000000000000..181a397271012 --- /dev/null +++ b/code/_globalvars/lists/jobs.dm @@ -0,0 +1,3 @@ +GLOBAL_LIST_EMPTY(occupations) +GLOBAL_LIST_EMPTY(name_occupations) +GLOBAL_LIST_EMPTY(type_occupations) diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm deleted file mode 100644 index 03cf06e7776b4..0000000000000 --- a/code/controllers/subsystem/job.dm +++ /dev/null @@ -1,100 +0,0 @@ -SUBSYSTEM_DEF(job) - name = "Jobs" - init_order = INIT_ORDER_JOBS - flags = SS_NO_FIRE - - var/list/occupations = list() //List of all jobs - var/list/datum/job/name_occupations = list() //Dict of all jobs, keys are titles - var/list/type_occupations = list() //Dict of all jobs, keys are types - -/datum/controller/subsystem/job/Initialize(timeofday) - if(!occupations.len) - SetupOccupations() - return ..() - -/datum/controller/subsystem/job/proc/SetupOccupations() - occupations = list() - var/list/all_jobs = subtypesof(/datum/job) - if(!all_jobs.len) - to_chat(world, "Error setting up jobs, no job datums found") - return 0 - - for(var/J in all_jobs) - var/datum/job/job = new J() - if(!job) - continue - occupations += job - name_occupations[job.name] = job - type_occupations[J] = job - - return 1 - -/datum/controller/subsystem/job/proc/GetJob(rank) - if(!occupations.len) - SetupOccupations() - if(istype(rank, /datum/job)) - return rank - return name_occupations[rank] - -/datum/controller/subsystem/job/proc/GetJobType(jobtype) - if(!occupations.len) - SetupOccupations() - return type_occupations[jobtype] - -/datum/controller/subsystem/job/Recover() - set waitfor = FALSE - var/oldjobs = SSjob.occupations - -/atom/proc/join_player_here(mob/M) - // By default, just place the mob on the same turf as the marker or whatever. - M.forceMove(get_turf(src)) - -/obj/structure/chair/join_player_here(mob/M) - // Placing a mob in a chair will attempt to buckle it, or else fall back to default. - if (isliving(M) && buckle_mob(M, FALSE, FALSE)) - return - ..() - -/datum/controller/subsystem/job/proc/get_manifest() - var/list/manifest_out = list() - for(var/datum/overmap/ship/controlled/ship as anything in SSovermap.controlled_ships) - if(!length(ship.manifest)) - continue - manifest_out["[ship.name] ([ship.source_template.short_name])"] = list() - for(var/crewmember in ship.manifest) - var/datum/job/crewmember_job = ship.manifest[crewmember] - manifest_out["[ship.name] ([ship.source_template.short_name])"] += list(list( - "name" = crewmember, - "rank" = crewmember_job.name, - "officer" = crewmember_job.officer - )) - - return manifest_out - -/datum/controller/subsystem/job/proc/get_manifest_html(monochrome = FALSE) - var/list/manifest = get_manifest() - var/dat = {" - - - - "} - for(var/department in manifest) - var/list/entries = manifest[department] - dat += "" - //JUST - var/even = FALSE - for(var/entry in entries) - var/list/entry_list = entry - dat += "" - even = !even - - dat += "
NameRank
[department]
[entry_list["name"]][entry_list["rank"]]
" - dat = replacetext(dat, "\n", "") - dat = replacetext(dat, "\t", "") - return dat diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index 89f5fa727f67d..456ec9a37dfda 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -199,7 +199,7 @@ SUBSYSTEM_DEF(mapping) var/value = job_slot_list[job] var/slots if(isnum(value)) - job_slot = SSjob.GetJob(job) + job_slot = GLOB.name_occupations[job] slots = value else if(islist(value)) var/datum/outfit/job_outfit = text2path(value["outfit"]) @@ -207,6 +207,7 @@ SUBSYSTEM_DEF(mapping) stack_trace("Invalid job outfit! [value["outfit"]] on [S.name]'s config! Defaulting to assistant clothing.") job_outfit = /datum/outfit/job/assistant job_slot = new /datum/job(job, job_outfit) + job_slot.display_order = length(S.job_slots) job_slot.wiki_page = value["wiki_page"] job_slot.officer = value["officer"] slots = value["slots"] diff --git a/code/controllers/subsystem/overmap.dm b/code/controllers/subsystem/overmap.dm index 61c0b5df0255c..d59dc0a2971ef 100644 --- a/code/controllers/subsystem/overmap.dm +++ b/code/controllers/subsystem/overmap.dm @@ -400,6 +400,49 @@ SUBSYSTEM_DEF(overmap) ship_count++ return ship_count +/datum/controller/subsystem/overmap/proc/get_manifest() + var/list/manifest_out = list() + for(var/datum/overmap/ship/controlled/ship as anything in controlled_ships) + if(!length(ship.manifest)) + continue + manifest_out["[ship.name] ([ship.source_template.short_name])"] = list() + for(var/crewmember in ship.manifest) + var/datum/job/crewmember_job = ship.manifest[crewmember] + manifest_out["[ship.name] ([ship.source_template.short_name])"] += list(list( + "name" = crewmember, + "rank" = crewmember_job.name, + "officer" = crewmember_job.officer + )) + + return manifest_out + +/datum/controller/subsystem/overmap/proc/get_manifest_html(monochrome = FALSE) + var/list/manifest = get_manifest() + var/dat = {" + + + + "} + for(var/department in manifest) + var/list/entries = manifest[department] + dat += "" + var/even = FALSE + for(var/entry in entries) + var/list/entry_list = entry + dat += "" + even = !even + + dat += "
NameRank
[department]
[entry_list["name"]][entry_list["rank"]]
" + dat = replacetext(dat, "\n", "") + dat = replacetext(dat, "\t", "") + return dat + /datum/controller/subsystem/overmap/Recover() if(istype(SSovermap.overmap_objects)) overmap_objects = SSovermap.overmap_objects diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index c4e77d9e2bc17..07f93bc431fb3 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -269,7 +269,7 @@ /datum/world_topic/manifest/Run(list/input) . = list() - var/list/manifest = SSjob.get_manifest() + var/list/manifest = SSovermap.get_manifest() for(var/department in manifest) var/list/entries = manifest[department] var/list/dept_entries = list() diff --git a/code/game/atoms.dm b/code/game/atoms.dm index e0f711640db3e..da031bb27818b 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1635,3 +1635,8 @@ else //We inline a MAPTEXT() here, because there's no good way to statically add to a string like this active_hud.screentip_text.maptext = "[name]" + +///Called whenever a player is spawned on the same turf as this atom. +/atom/proc/join_player_here(mob/M) + // By default, just place the mob on the same turf as the marker or whatever. + M.forceMove(get_turf(src)) diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index 7c97e4fa6d8ee..c47333a80a0d0 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -32,60 +32,9 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) /datum/crewmonitor var/list/ui_sources = list() //List of user -> ui source - var/list/jobs var/list/data_by_z = list() var/list/last_update = list() -/datum/crewmonitor/New() - . = ..() - - var/list/jobs = new/list() - jobs["Captain"] = 00 - jobs["Head of Personnel"] = 02 - jobs["SolGov Representative"] = 05 //WS Edit - SolGov Rep - jobs["Head of Security"] = 10 - jobs["Warden"] = 11 - jobs["Security Officer"] = 12 - jobs["Detective"] = 13 - jobs["Brig Physician"] = 14 - jobs["Chief Medical Officer"] = 20 - jobs["Chemist"] = 21 - jobs["Virologist"] = 22 - jobs["Medical Doctor"] = 23 - jobs["Paramedic"] = 24 - jobs["Research Director"] = 30 - jobs["Scientist"] = 31 - jobs["Roboticist"] = 32 - jobs["Geneticist"] = 33 - jobs["Chief Engineer"] = 40 - jobs["Station Engineer"] = 41 - jobs["Atmospheric Technician"] = 42 - jobs["Quartermaster"] = 51 - jobs["Shaft Miner"] = 52 - jobs["Cargo Technician"] = 53 - jobs["Bartender"] = 61 - jobs["Cook"] = 62 - jobs["Botanist"] = 63 - jobs["Curator"] = 64 - jobs["Chaplain"] = 65 - jobs["Clown"] = 66 - jobs["Mime"] = 67 - jobs["Janitor"] = 68 - jobs["Lawyer"] = 69 - jobs["Psychologist"] = 70 - jobs["Admiral"] = 200 - jobs["CentCom Commander"] = 210 - jobs["Custodian"] = 211 - jobs["Medical Officer"] = 212 - jobs["Research Officer"] = 213 - jobs["Emergency Response Team Commander"] = 220 - jobs["Security Response Officer"] = 221 - jobs["Engineer Response Officer"] = 222 - jobs["Medical Response Officer"] = 223 - jobs["Assistant"] = 999 //Unknowns/custom jobs should appear after civilians, and before assistants - - src.jobs = jobs - /datum/crewmonitor/Destroy() return ..() @@ -120,8 +69,8 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) var/obj/item/clothing/under/U var/obj/item/card/id/I var/turf/pos - var/ijob - var/name + var/ijob = JOB_DISPLAY_ORDER_DEFAULT + var/name = "Unknown" var/assignment var/oxydam var/toxdam @@ -156,30 +105,18 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) if (I) name = I.registered_name assignment = I.assignment - if(I.assignment in jobs) - ijob = jobs[I.assignment] - else - ijob = jobs["Unknown"] - else - name = "Unknown" - assignment = "" - ijob = 80 + if(I.assignment in GLOB.name_occupations) + var/datum/job/assigned_job = GLOB.name_occupations[I.assignment] + ijob = assigned_job.display_order if (nanite_sensors || U.sensor_mode >= SENSOR_LIVING) life_status = ((H.stat < DEAD) ? TRUE : FALSE) //So anything less that dead is marked as alive. (Soft crit, concious, unconcious) - else - life_status = null if (nanite_sensors || U.sensor_mode >= SENSOR_VITALS) oxydam = round(H.getOxyLoss(),1) toxdam = round(H.getToxLoss(),1) burndam = round(H.getFireLoss(),1) brutedam = round(H.getBruteLoss(),1) - else - oxydam = null - toxdam = null - burndam = null - brutedam = null if (nanite_sensors || U.sensor_mode >= SENSOR_COORDS) if (!pos) @@ -187,14 +124,10 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) area = get_area_name(H, TRUE) pos_x = pos.x pos_y = pos.y - else - area = null - pos_x = null - pos_y = null results[++results.len] = list("name" = name, "assignment" = assignment, "ijob" = ijob, "life_status" = life_status, "oxydam" = oxydam, "toxdam" = toxdam, "burndam" = burndam, "brutedam" = brutedam, "area" = area, "pos_x" = pos_x, "pos_y" = pos_y, "can_track" = H.can_track(null)) - data_by_z["[z]"] = sortTim(results,/proc/sensor_compare) + data_by_z["[z]"] = sortTim(results, /proc/sensor_compare) last_update["[z]"] = world.time return results diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index dfa27f6f21f47..3c97186cba405 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -372,7 +372,7 @@ GLOBAL_LIST_EMPTY(PDAs) if(41) //crew manifest dat += "

Crew Manifest

" dat += "
" - dat += SSjob.get_manifest_html() + dat += SSovermap.get_manifest_html() dat += "
" if(3) diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index d07a356107ff3..1e96a5b3ce01a 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -233,7 +233,7 @@ Code: Send Signal
"} if (41) //crew manifest menu = "

[PDAIMG(notes)] Crew Manifest

" - menu += "
[SSjob.get_manifest_html()]
" + menu += "
[SSovermap.get_manifest_html()]
" if (42) //status displays diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index a920c6f26760d..eeaaf0adc9820 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -311,9 +311,6 @@ new /obj/item/stack/rods(get_turf(loc), 2) qdel(src) - - - /obj/item/chair/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(attack_type == UNARMED_ATTACK && prob(hit_reaction_chance)) owner.visible_message("[owner] fends off [attack_text] with [src]!") @@ -332,6 +329,12 @@ C.Paralyze(20) smash(user) +/obj/structure/chair/join_player_here(mob/M) + // Placing a mob in a chair will attempt to buckle it, or else fall back to default. + if (isliving(M) && buckle_mob(M, FALSE, FALSE)) + return + ..() + /obj/item/chair/greyscale material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS origin_type = /obj/structure/chair/greyscale diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index 641a070f1ddcf..254be079de1a6 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -102,7 +102,7 @@ return FALSE var/datum/outfit/job/O = new outfit_type() var/list/outfit_types = O.get_chameleon_disguise_info() - var/datum/job/job_datum = SSjob.GetJobType(O.jobtype) + var/datum/job/job_datum = GLOB.type_occupations[O.jobtype] for(var/V in user.chameleon_item_actions) var/datum/action/item_action/chameleon/change/A = V diff --git a/code/modules/jobs/job_exp.dm b/code/modules/jobs/job_exp.dm index 9db25e4fc93a2..4813e4aa3c397 100644 --- a/code/modules/jobs/job_exp.dm +++ b/code/modules/jobs/job_exp.dm @@ -88,7 +88,7 @@ GLOBAL_PROTECT(exp_to_update) play_records[exp_read.item[1]] = text2num(exp_read.item[2]) qdel(exp_read) - for(var/rtype in SSjob.name_occupations) + for(var/rtype in GLOB.name_occupations) if(!play_records[rtype]) play_records[rtype] = 0 for(var/rtype in GLOB.exp_specialmap) @@ -139,7 +139,7 @@ GLOBAL_PROTECT(exp_to_update) if(announce_changes) to_chat(src,"You got: [minutes] Living EXP!") if(mob.mind.assigned_role) - for(var/job in SSjob.name_occupations) + for(var/job in GLOB.name_occupations) if(mob.mind.assigned_role == job) rolefound = TRUE play_records[job] += minutes diff --git a/code/modules/jobs/job_report.dm b/code/modules/jobs/job_report.dm index 88c7f7ad1902c..cbc43f4110bfd 100644 --- a/code/modules/jobs/job_report.dm +++ b/code/modules/jobs/job_report.dm @@ -32,7 +32,7 @@ data["jobPlaytimes"] = list() data["specialPlaytimes"] = list() - for (var/job_name in SSjob.name_occupations) + for (var/job_name in GLOB.name_occupations) var/playtime = play_records[job_name] ? text2num(play_records[job_name]) : 0 data["jobPlaytimes"][job_name] = playtime diff --git a/code/modules/jobs/job_types/_job.dm b/code/modules/jobs/job_types/_job.dm index 93181f40ee18f..206c0746bc85c 100644 --- a/code/modules/jobs/job_types/_job.dm +++ b/code/modules/jobs/job_types/_job.dm @@ -33,6 +33,14 @@ if(new_name) name = new_name outfit = new_outfit + register() + +/datum/job/proc/register() + GLOB.occupations += src + if(name in GLOB.name_occupations) + return + + GLOB.name_occupations[name] = src //Only override this proc //H is usually a human unless an /equip override transformed it @@ -253,9 +261,9 @@ if(visualsOnly) return - var/datum/job/J = SSjob.GetJobType(jobtype) + var/datum/job/J = GLOB.type_occupations[jobtype] if(!J) - J = SSjob.GetJob(H.job) + J = GLOB.name_occupations[H.job] var/obj/item/card/id/C = H.wear_id if(istype(C)) diff --git a/code/modules/mob/dead/crew_manifest.dm b/code/modules/mob/dead/crew_manifest.dm index 355af961f299a..c7ca52968f865 100644 --- a/code/modules/mob/dead/crew_manifest.dm +++ b/code/modules/mob/dead/crew_manifest.dm @@ -19,5 +19,5 @@ /datum/crew_manifest/ui_static_data(mob/user) return list( - "manifest" = SSjob.get_manifest() + "manifest" = SSovermap.get_manifest() ) diff --git a/code/modules/mob/living/simple_animal/hostile/zombie.dm b/code/modules/mob/living/simple_animal/hostile/zombie.dm index bbd925035043f..2de9fba686786 100644 --- a/code/modules/mob/living/simple_animal/hostile/zombie.dm +++ b/code/modules/mob/living/simple_animal/hostile/zombie.dm @@ -33,7 +33,7 @@ dummy_prefs.pref_species = new /datum/species/zombie dummy_prefs.randomise[RANDOM_BODY] = TRUE if(zombiejob) - var/datum/job/J = SSjob.GetJob(zombiejob) + var/datum/job/J = GLOB.name_occupations[zombiejob] var/datum/outfit/O if(J.outfit) O = new J.outfit diff --git a/shiptest.dme b/shiptest.dme index 6d120b60a3d0e..d1f9004ca3083 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -224,6 +224,7 @@ #include "code\_globalvars\lists\admin.dm" #include "code\_globalvars\lists\client.dm" #include "code\_globalvars\lists\flavor_misc.dm" +#include "code\_globalvars\lists\jobs.dm" #include "code\_globalvars\lists\keybindings.dm" #include "code\_globalvars\lists\maintenance_loot.dm" #include "code\_globalvars\lists\mapping.dm" @@ -320,7 +321,6 @@ #include "code\controllers\subsystem\idlenpcpool.dm" #include "code\controllers\subsystem\input.dm" #include "code\controllers\subsystem\ipintel.dm" -#include "code\controllers\subsystem\job.dm" #include "code\controllers\subsystem\jukeboxes.dm" #include "code\controllers\subsystem\language.dm" #include "code\controllers\subsystem\lighting.dm"