diff --git a/_maps/gateway_test.json b/_maps/gateway_test.json index 0b3923162f6..df38ec4c5b8 100644 --- a/_maps/gateway_test.json +++ b/_maps/gateway_test.json @@ -7,6 +7,7 @@ "load_all_away_missions": true, "ignored_unit_tests": [ "/datum/unit_test/antag_moodlets", + "/datum/unit_test/cargo_dep_order_locations", "/datum/unit_test/job_roundstart_spawnpoints", "/datum/unit_test/required_map_items", "/datum/unit_test/space_dragon_expiration", diff --git a/_maps/multiz_debug.json b/_maps/multiz_debug.json index 7f44673da3d..e83101d74d7 100644 --- a/_maps/multiz_debug.json +++ b/_maps/multiz_debug.json @@ -4,6 +4,7 @@ "map_path": "map_files/debug", "map_file": "multiz.dmm", "ignored_unit_tests": [ + "/datum/unit_test/cargo_dep_order_locations", "/datum/unit_test/job_roundstart_spawnpoints", "/datum/unit_test/required_map_items", "/datum/unit_test/spy_bounty" diff --git a/_maps/runtimestation.json b/_maps/runtimestation.json index ee042270c0a..12f854ce425 100644 --- a/_maps/runtimestation.json +++ b/_maps/runtimestation.json @@ -5,6 +5,7 @@ "map_file": "runtimestation.dmm", "space_ruin_levels": 1, "ignored_unit_tests": [ + "/datum/unit_test/cargo_dep_order_locations", "/datum/unit_test/job_roundstart_spawnpoints", "/datum/unit_test/required_map_items", "/datum/unit_test/spy_bounty" diff --git a/code/modules/jobs/departments/departments.dm b/code/modules/jobs/departments/departments.dm index ce21920eced..c87e1dc31c5 100644 --- a/code/modules/jobs/departments/departments.dm +++ b/code/modules/jobs/departments/departments.dm @@ -28,15 +28,6 @@ /// A list of generic access flags people in this department generally have. var/list/department_access = list() -/datum/job_department/New() - . = ..() - for(var/delivery_area_type in department_delivery_areas) - if(GLOB.areas_by_type[delivery_area_type]) - return - //every area fallback didn't exist on this map so throw a mapping error and set some generic area that uuuh please exist okay - log_mapping("[type] has no valid areas to deliver to on this map, add some more fallback areas to its \"department_delivery_areas\" var.") - department_delivery_areas = list(/area/station/hallway/primary/central) //if this doesn't exist like honestly fuck your map man - /// Handles adding jobs to the department and setting up the job bitflags. /datum/job_department/proc/add_job(datum/job/job) department_jobs += job @@ -111,7 +102,10 @@ label_class = "engineering" ui_color = "#dfb567" nation_prefixes = list("Atomo", "Engino", "Power", "Teleco") - department_delivery_areas = list(/area/station/engineering/main) + department_delivery_areas = list( + /area/station/engineering/main, + /area/station/engineering/lobby, + ) associated_cargo_groups = list("Engineering", "Engine Construction", "Canisters & Materials") head_of_staff_access = ACCESS_CE department_access = REGION_ACCESS_ENGINEERING @@ -144,7 +138,11 @@ label_class = "science" ui_color = "#c973c9" nation_prefixes = list("Sci", "Griffa", "Geneti", "Explosi", "Mecha", "Xeno", "Nani", "Cyto") - department_delivery_areas = list(/area/station/science/research) + department_delivery_areas = list( + /area/station/science/research, + /area/station/science/lobby, + /area/station/science/lab, + ) associated_cargo_groups = list("Science", "Livestock", "Canisters & Materials") head_of_staff_access = ACCESS_RD department_access = REGION_ACCESS_RESEARCH diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 1d7654b7530..2d3bb5cfe96 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -109,6 +109,7 @@ #include "cable_powernets.dm" #include "card_mismatch.dm" #include "cardboard_cutouts.dm" +#include "cargo_dep_order_locations.dm" #include "cargo_selling.dm" #include "chain_pull_through_space.dm" #include "changeling.dm" diff --git a/code/modules/unit_tests/cargo_dep_order_locations.dm b/code/modules/unit_tests/cargo_dep_order_locations.dm new file mode 100644 index 00000000000..106a0eb19a7 --- /dev/null +++ b/code/modules/unit_tests/cargo_dep_order_locations.dm @@ -0,0 +1,18 @@ +/datum/unit_test/cargo_dep_order_locations + +/datum/unit_test/cargo_dep_order_locations/Run() + for(var/datum/job_department/department as anything in SSjob.joinable_departments) + var/delivery_areas = department.department_delivery_areas + if(!length(delivery_areas)) + continue + if(check_valid_delivery_location(delivery_areas)) + continue + TEST_FAIL("[department.type] failed to find a valid delivery location on this map.") + + +/datum/unit_test/cargo_dep_order_locations/proc/check_valid_delivery_location(list/delivery_areas) + for(var/delivery_area_type in delivery_areas) + + if(GLOB.areas_by_type[delivery_area_type]) + return TRUE + return FALSE