From cb0f8f33aced1a00f4f5bc5f9da0ea87ae8b5082 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Thu, 13 Mar 2025 18:07:45 -0700 Subject: [PATCH] [MIRROR] up port map tests (#10378) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- .../station/protean_vr/protean_powers.dm | 6 +-- code/unit_tests/map_tests.dm | 48 +++++++++++++++++-- .../relic_base/submaps/redgate/cybercity.dmm | 8 +--- 3 files changed, 49 insertions(+), 13 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm index 581268732c..80593e80ad 100644 --- a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm @@ -574,7 +574,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = tgui_color_picker(src, "Pick shell color:","Shell Color", S.dullahan_overlays[3]) + var/new_color = tgui_color_picker(protie, "Pick shell color:","Shell Color", S.dullahan_overlays[3]) if(!new_color) return 0 S.dullahan_overlays[3] = choice //metal overlay is 3, eyes is 4 @@ -593,7 +593,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = tgui_color_picker(src, "Pick eye color:","Eye Color", S.dullahan_overlays[4]) + var/new_color = tgui_color_picker(protie, "Pick eye color:","Eye Color", S.dullahan_overlays[4]) if(!new_color) return 0 S.dullahan_overlays[4] = choice @@ -606,7 +606,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = tgui_color_picker(src, "Pick decal color:","Decal Color", S.dullahan_overlays[5]) + var/new_color = tgui_color_picker(protie, "Pick decal color:","Decal Color", S.dullahan_overlays[5]) if(!new_color) return 0 S.dullahan_overlays[5] = choice diff --git a/code/unit_tests/map_tests.dm b/code/unit_tests/map_tests.dm index acbf69c246..a2f1ea816d 100644 --- a/code/unit_tests/map_tests.dm +++ b/code/unit_tests/map_tests.dm @@ -47,9 +47,21 @@ var/area_good = 1 var/bad_msg = "--------------- [A.name]([A.type])" - if(isnull(A.apc) && !(A.type in exempt_from_apc)) - log_unit_test("[bad_msg] lacks an APC. (X[A.x]|Y[A.y]) - Z[A.z])") - area_good = 0 + // Scan for areas with extra APCs + if(!(A.type in exempt_from_apc)) + if(isnull(A.apc)) + log_unit_test("[bad_msg] lacks an APC. (X[A.x]|Y[A.y]) - Z[A.z])") + area_good = 0 + else + var/list/apc_list = list() + for(var/turf/T in get_current_area_turfs(A)) + for(var/atom/S in T.contents) + if(istype(S,/obj/machinery/power/apc)) + apc_list.Add(S) + if(apc_list.len > 1) + area_good = 0 + for(var/obj/machinery/power/P in apc_list) + log_unit_test("[bad_msg] has too many APCs. (X[P.x]|Y[P.y]) - Z[P.z])") if(!A.air_scrub_info.len && !(A.type in exempt_from_atmos)) log_unit_test("[bad_msg] lacks an Air scrubber. (X[A.x]|Y[A.y]) - (Z[A.z])") @@ -198,3 +210,33 @@ pass("No active edges.") return 1 + +/datum/unit_test/ladder_test + name = "MAP: Ladder Test" + +/datum/unit_test/ladder_test/start_test() + var/failed = FALSE + + for(var/obj/structure/ladder/L in world) + var/turf/T = get_turf(L) + if(!T) + log_unit_test("[L.x].[L.y].[L.z]: Map - Ladder on invalid turf") + failed = TRUE + continue + if(L.allowed_directions & UP) + if(!L.target_up) + log_unit_test("[T.x].[T.y].[T.z]: Map - Ladder allows upward movement, but had no ladder above it") + failed = TRUE + if(L.allowed_directions & DOWN) + if(!L.target_down) + log_unit_test("[T.x].[T.y].[T.z]: Map - Ladder allows downward movement, but had no ladder beneath it") + failed = TRUE + if(T.density) + log_unit_test("[L.x].[L.y].[L.z]: Map - Ladder is inside a wall") + failed = TRUE + + if(failed) + fail("Ladders were incorrectly placed, or missing connections.") + else + pass("All ladders were correctly placed and had connections.") + return failed diff --git a/modular_chomp/maps/relic_base/submaps/redgate/cybercity.dmm b/modular_chomp/maps/relic_base/submaps/redgate/cybercity.dmm index 5a369b9a52..ae8f8105b6 100644 --- a/modular_chomp/maps/relic_base/submaps/redgate/cybercity.dmm +++ b/modular_chomp/maps/relic_base/submaps/redgate/cybercity.dmm @@ -7558,12 +7558,6 @@ /obj/item/clothing/under/color/lightred, /turf/simulated/floor/wood, /area/redgate/city/apartments) -"jZT" = ( -/obj/structure/ladder/up{ - pixel_y = 7 - }, -/turf/simulated/floor/water/indoors, -/area/redgate/city/pool) "kay" = ( /obj/structure/sink{ dir = 8; @@ -34112,7 +34106,7 @@ iLu nqa eRt gue -jZT +lxg lxg lxg dDr