Commit 2e613fa 1 parent e3e6d12 commit 2e613fa Copy full SHA for 2e613fa
File tree 3 files changed +31
-0
lines changed
code/modules/unit_tests/mapping_standards
3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 3
3
#include "_mapping_standards.dm"
4
4
5
5
#include "ladders_must_have_openspace.dm"
6
+ #include "one_light_per_tile.dm"
Original file line number Diff line number Diff line change 4
4
// If you encounter it, well. Good luck and god help you -Francinum
5
5
6
6
/ datum / unit_test/ mapping_standards/ ladders_must_have_openspace
7
+ name = " MAPSTANDARDS: Ladders must have openspace"
7
8
8
9
/ datum / unit_test/ mapping_standards/ ladders_must_have_openspace/ Run()
9
10
if (.. ()) {return };
Original file line number Diff line number Diff line change
1
+ / datum / unit_test/ mapping_standards/ lights_per_tile
2
+ name = " MAPSTANDARDS: Tiles should have only one light"
3
+
4
+ / datum / unit_test/ mapping_standards/ lights_per_tile/ Run()
5
+ if (.. ()) {return };
6
+
7
+ var /list /turf/checked_turfs = list ()
8
+ var /list /turf/failed_turfs = list ()
9
+
10
+ for (var /obj /machinery/light/fixture in INSTANCES_OF (/ obj / machinery/ light))
11
+ var /area /fixture_area = get_area(fixture)
12
+ if (! (fixture_area. type in GLOB . the_station_areas))
13
+ continue // Skip non-station lights.
14
+
15
+ var /turf /light_turf = get_turf(fixture)
16
+ if (light_turf in checked_turfs)
17
+
18
+ if (light_turf in failed_turfs)
19
+ continue // We've already reported this tile.
20
+
21
+ failed_turfs. Add(light_turf)
22
+
23
+ var /light_count = 0
24
+ for (var /obj /machinery/light/_counter in light_turf)
25
+ light_count++
26
+ TEST_FAIL (" [ light_count] lights on tile at [ AREACOORD (light_turf)] " )
27
+ continue // Continue, we've already added it to the list.
28
+
29
+ checked_turfs. Add(light_turf)
You can’t perform that action at this time.
0 commit comments