Files
Bubberstation/code/modules/unit_tests/cargo_dep_order_locations.dm
SkyratBot 7f04d5ba28 [MIRROR] Moves the departmental delivery area check to a unit test so it stops spamming logs (#27719)
* 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.

![image](https://github.com/tgstation/tgstation/assets/49160555/add92847-9d41-49b0-a951-4f40fdfd283f)

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>
2024-05-15 11:48:29 +02:00

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