-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] Moves the departmental delivery area check to a unit test so…
… it stops spamming logs (#2486) (#3323) * 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: NovaBot <[email protected]> Co-authored-by: Waterpig <[email protected]> Co-authored-by: NovaBot13 <[email protected]>
- Loading branch information
1 parent
2d54e1e
commit d1aa68e
Showing
6 changed files
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |