Let's see what broke this time
This commit is contained in:
Fluffy
2024-10-16 19:06:20 +00:00
committed by GitHub
parent b7ccc74979
commit bec05df121
10 changed files with 168 additions and 5642 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ Class Procs:
var/needs_update = 0
var/list/edges
var/list/connection_edge/edges
var/datum/gas_mixture/air = new
+3
View File
@@ -197,6 +197,9 @@
return TRUE
/datum/map_template/proc/get_affected_turfs(turf/T, centered = FALSE)
SHOULD_NOT_SLEEP(TRUE)
RETURN_TYPE(/list/turf)
var/turf/placement = T
if(centered)
var/turf/corner = locate(placement.x - round(width / 2), placement.y - round(height / 2), placement.z)
@@ -73,7 +73,7 @@
possible_themes = list(/datum/exoplanet_theme/barren/asteroid, /datum/exoplanet_theme/barren/asteroid/ice)
ruin_planet_type = PLANET_LORE
features_budget = 3
ruin_type_whitelist = list(/datum/map_template/ruin/exoplanet/heph_mining_station, /datum/map_template/ruin/exoplanet/miners_guild_outpost, /datum/map_template/ruin/exoplanet/sol_listening_post, /datum/map_template/ruin/exoplanet/crashed_sol_shuttle_01, /datum/map_template/ruin/exoplanet/crashed_skrell_shuttle_01, /datum/map_template/ruin/exoplanet/digsite, /datum/map_template/ruin/exoplanet/abandoned_outpost, /datum/map_template/ruin/exoplanet/izweski_probe, /datum/map_template/ruin/exoplanet/heph_survey_post, /datum/map_template/ruin/exoplanet/kazhkz_crash)
ruin_type_whitelist = list(/datum/map_template/ruin/exoplanet/heph_mining_station, /datum/map_template/ruin/exoplanet/miners_guild_outpost, /datum/map_template/ruin/exoplanet/sol_listening_post, /datum/map_template/ruin/exoplanet/crashed_sol_shuttle_01, /datum/map_template/ruin/exoplanet/crashed_skrell_shuttle_01, /datum/map_template/ruin/exoplanet/digsite, /datum/map_template/ruin/exoplanet/izweski_probe, /datum/map_template/ruin/exoplanet/heph_survey_post, /datum/map_template/ruin/exoplanet/kazhkz_crash)
/obj/effect/overmap/visitable/sector/exoplanet/barren/asteroid/ytizi/pre_ruin_preparation()
if(istype(theme, /datum/exoplanet_theme/barren/asteroid/ice))
@@ -97,7 +97,7 @@
ring_chance = 0
ruin_planet_type = PLANET_LORE
place_near_main = list(2,2)
ruin_type_whitelist = list(/datum/map_template/ruin/exoplanet/heph_mining_station, /datum/map_template/ruin/exoplanet/miners_guild_outpost, /datum/map_template/ruin/exoplanet/digsite, /datum/map_template/ruin/exoplanet/abandoned_outpost, /datum/map_template/ruin/exoplanet/crashed_sol_shuttle_01, /datum/map_template/ruin/exoplanet/crashed_skrell_shuttle_01, /datum/map_template/ruin/exoplanet/izweski_probe, /datum/map_template/ruin/exoplanet/heph_survey_post, /datum/map_template/ruin/exoplanet/kazhkz_crash)
ruin_type_whitelist = list(/datum/map_template/ruin/exoplanet/heph_mining_station, /datum/map_template/ruin/exoplanet/miners_guild_outpost, /datum/map_template/ruin/exoplanet/digsite, /datum/map_template/ruin/exoplanet/crashed_sol_shuttle_01, /datum/map_template/ruin/exoplanet/crashed_skrell_shuttle_01, /datum/map_template/ruin/exoplanet/izweski_probe, /datum/map_template/ruin/exoplanet/heph_survey_post, /datum/map_template/ruin/exoplanet/kazhkz_crash)
scanimage = "chanterel.png"
/obj/effect/overmap/visitable/sector/exoplanet/barren/asteroid/chanterel/generate_planet_image()
+14 -1
View File
@@ -75,8 +75,15 @@ GLOBAL_LIST_EMPTY(banned_ruin_ids)
available -= ruin
continue
log_admin("Ruin \"[ruin.name]\" placed at ([choice.x], [choice.y], [choice.z])!")
log_admin("Loading ruin \"[ruin.name]\" ([ruin.type]) with center turf ([choice.x], [choice.y], [choice.z])!")
load_ruin(choice, ruin)
log_module_ruins("Ruin \"[ruin.name]\" ([ruin.type]) loaded with geometry: Lower X: [choice.x - round(ruin.width / 2)] - Lower Y [choice.y - round(ruin.height / 2)] -- Upper X: [choice.x + round(ruin.width / 2)] - Upper Y: [choice.y + round(ruin.height / 2)]")
#if defined(UNIT_TEST)
var/list/turf/affected_turfs = ruin.get_affected_turfs(choice, TRUE)
GLOB.turfs_to_map_type["[ruin.type]"] = affected_turfs
#endif
selected += ruin
for(var/ruin_path in ruin.force_ruins)
@@ -106,6 +113,12 @@ GLOBAL_LIST_EMPTY(banned_ruin_ids)
log_admin("Ruin \"[ruin.name]\" force-spawned at ([choice.x], [choice.y], [choice.z])!")
load_ruin(choice, ruin)
#if defined(UNIT_TEST)
var/list/turf/affected_turfs = ruin.get_affected_turfs(choice, TRUE)
GLOB.turfs_to_map_type["[ruin.type]"] = affected_turfs
#endif
selected += ruin
if(!(ruin.template_flags & TEMPLATE_FLAG_ALLOW_DUPLICATES))
+89 -18
View File
@@ -14,6 +14,17 @@
#define FAILURE 0
#define SUCCESS 1
#if defined(UNIT_TEST)
/**
* A list of string-keyes lists that maps the type of what we put there to the turfs
*
* Keys are strings of typepaths, values are lists of turfs
*
* list("/datum/map_template/whatever" = list(/turf/simulated, /turf/simulated))
*/
GLOBAL_LIST_EMPTY(turfs_to_map_type)
#endif
//
// Generic check for an area.
//
@@ -211,54 +222,114 @@
compose a message and fail the test, let the poor soul try to figure out where the issue is, assuming it's not intermittent
*/
var/fail_message = "\n\n\n\n\n[SSair.active_edges.len] edges active at round-start!\n"
#if defined(UNIT_TEST)
var/list/affected_map_types = list()
#endif
for(var/connection_edge/E in SSair.active_edges)
var/connection_edge/unsimulated/U = E
if(istype(U))
//Unsimulated edge
if(istype(E, /connection_edge/unsimulated))
var/connection_edge/unsimulated/U = E
var/turf/T = U.B
var/zone/zas_zone = U.A
fail_message += "Unsimulated edge between [zas_zone] and [T]\n"
if(istype(T))
fail_message += "--> [U.A.name] and [T.name] ([T.x], [T.y], [T.z]) have mismatched gas mixtures! <--\n"
fail_message += "--> [zas_zone.name] and [T.name] ([T.x], [T.y], [T.z]) have mismatched gas mixtures! <--\n"
else
fail_message += "--> [U.A.name] and [U.B] have mismatched gas mixtures! <--\n"
fail_message += "--> [zas_zone.name] and [T] have mismatched gas mixtures! <--\n"
//Let's see if we can get what turfs are on the edge connection
fail_message += "[zas_zone.name] edge turfs:\n"
for(var/connection_edge/edge in zas_zone.edges)
if(edge.sleeping)
continue
for(var/turf/edge_turf in edge.connecting_turfs)
fail_message += "[edge_turf.type] ([edge_turf.x], [edge_turf.y], [edge_turf.z])\t"
fail_message += "\n\nMismatching edge gasses: [(zas_zone.air) ? json_encode(zas_zone.air.gas) : "vacuum"] <-----> [(T.air) ? json_encode(T.air.gas) : "vacuum"]\n\n"
var/zone/A = U.A
var/offending_turfs_text = "Problem turfs: \n"
fail_message += "Mismatching edge gasses: [(U.A.air) ? json_encode(U.A.air.gas) : "vacuum"] <-----> [(U.B.air) ? json_encode(U.B.air.gas) : "vacuum"]\n\n"
for(var/turf/simulated/S in A.contents)
for(var/turf/simulated/S in zas_zone.contents)
if(("oxygen" in S.initial_gas) || ("nitrogen" in S.initial_gas))
offending_turfs_text += "[S] \[[S.type]\] ([S.x], [S.y], [S.z])\t"
offending_turfs_text += "[S.type] ([S.x], [S.y], [S.z])\t"
fail_message += "[offending_turfs_text]"
#if defined(UNIT_TEST)
for(var/type in GLOB.turfs_to_map_type)
if(S in GLOB.turfs_to_map_type[type])
affected_map_types |= type
#endif
fail_message += "[offending_turfs_text]\n\n"
//Simulated edge (zone edge)
else
var/connection_edge/zone/Z = E
if(!istype(Z))
stack_trace("Somehow, an edge is neither an unsimulated edge nor a zone edge!")
return
var/zone/first_zone = Z.A
var/zone/second_zone = Z.B
fail_message += "Simulated edge between [first_zone.name] and [second_zone.name]\n"
//Let's see if we can get what turfs are on the edge connection
fail_message += "[first_zone.name] and [second_zone.name] edge turfs:\n"
for(var/connection_edge/edge in (first_zone.edges + second_zone.edges))
if(edge.sleeping)
continue
for(var/turf/edge_turf in edge.connecting_turfs)
fail_message += "[edge_turf.type] ([edge_turf.x], [edge_turf.y], [edge_turf.z])\t"
//A list of turfs that are related to the found issue
var/list/turf/problem_turfs = list()
if(!istype(Z))
return
fail_message += "--> [Z.A.name] and [Z.B.name] have mismatched gas mixtures! <--\n"
fail_message += "\n\n--> [first_zone.name] and [second_zone.name] have mismatched gas mixtures! <--\n"
if(Z.A.air.gas.len && Z.B.air.gas.len)
fail_message += "--> Both zones have gas mixtures defined; either one is a normally vacuum zone exposed to a breach, or two differing gases are mixing at round-start. <--\n"
problem_turfs = Z.A.contents + Z.B.contents
problem_turfs = first_zone.contents + second_zone.contents
else if(Z.A.air.gas.len)
problem_turfs = Z.A.contents
problem_turfs = first_zone.contents
else if(Z.B.air.gas.len)
problem_turfs = Z.B.contents
problem_turfs = second_zone.contents
if(!length(problem_turfs))
continue
fail_message += "Mismatching edge gasses: [(Z.A.air) ? json_encode(Z.A.air.gas) : "vacuum"] <-----> [(Z.B.air) ? json_encode(Z.B.air.gas) : "vacuum"]\n\n"
fail_message += "Mismatching edge gasses: [(first_zone.air) ? json_encode(first_zone.air.gas) : "vacuum"] <-----> [(second_zone.air) ? json_encode(second_zone.air.gas) : "vacuum"]\n\n"
var/offending_turfs_text = "Problem turfs: "
for(var/turf/simulated/S in problem_turfs)
if(("oxygen" in S.initial_gas) || ("nitrogen" in S.initial_gas))
offending_turfs_text += "[S] \[[S.type]\] ([S.x], [S.y], [S.z])\t"
offending_turfs_text += "[S.type] ([S.x], [S.y], [S.z])\t"
#if defined(UNIT_TEST)
for(var/type in GLOB.turfs_to_map_type)
if(S in GLOB.turfs_to_map_type[type])
affected_map_types |= type
#endif
fail_message += "[offending_turfs_text]\n\n"
#if defined(UNIT_TEST)
if(length(affected_map_types))
TEST_FAIL("Affected map types: [english_list(affected_map_types)]")
#endif
fail_message += "[offending_turfs_text]"
TEST_FAIL("[fail_message]")
return UNIT_TEST_FAILED