mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 01:34:01 +00:00
* Moves the departmental delivery area check to a unit test so it stops spamming logs (#83215) ## About The Pull Request So, thanks to the map not being loaded yet when jobs are initialized, the logs are needlessly spammed by a check that can never pass.  Also adds some possible locations to engineering and science As such, I just moved all this logging stuff and screaming at mappers/coders into a unit test. I honestly only have very vague understanding of how these work so someone with more knowledge please check if I did everything right. * Moves the departmental delivery area check to a unit test so it stops spamming logs --------- Co-authored-by: Waterpig <49160555+Majkl-J@users.noreply.github.com>
19 lines
653 B
Plaintext
19 lines
653 B
Plaintext
/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
|