From 2e5b3a86df1f2d2df86844f09d668283df2da350 Mon Sep 17 00:00:00 2001 From: Azrun Date: Thu, 5 Sep 2024 00:35:10 -0700 Subject: [PATCH] Terrainify improvements --- +secret | 2 +- code/modules/admin/terrainify.dm | 15 ++++++++------ code/modules/worldgen/mapgen/RoomMaze.dm | 6 ++++-- code/turf/floors_unsimulated.dm | 25 ++++++++++++------------ 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/+secret b/+secret index 9b7f1c46498af..bc43df7e194c0 160000 --- a/+secret +++ b/+secret @@ -1 +1 @@ -Subproject commit 9b7f1c46498af82c1230a12282c3d6c362d04072 +Subproject commit bc43df7e194c001f92f38231af806f5189174ff7 diff --git a/code/modules/admin/terrainify.dm b/code/modules/admin/terrainify.dm index b7d04723d3c95..d95197df5154d 100644 --- a/code/modules/admin/terrainify.dm +++ b/code/modules/admin/terrainify.dm @@ -60,8 +60,7 @@ var/datum/station_zlevel_repair/station_repair = new proc/clean_up_station_level(replace_with_cars, add_sub, remove_parallax = TRUE, season=null) var/list/turfs_to_fix = get_turfs_to_fix() clear_out_turfs(turfs_to_fix) - - clear_around_beacons() + clear_out_turfs(get_beacon_turfs(), by_type[/obj/warp_beacon]) land_vehicle_fixup(replace_with_cars, add_sub) copy_gas_to_airless() @@ -132,12 +131,12 @@ var/datum/station_zlevel_repair/station_repair = new if(istype(man, /obj/machinery/manufacturer/hangar) && (man.z == Z_LEVEL_STATION)) man.add_schematic(/datum/manufacture/sub/wheels) - proc/clear_around_beacons() + proc/get_beacon_turfs() var/list/turfs_to_fix = list() for(var/obj/warp_beacon/W in by_type[/obj/warp_beacon]) - for(var/turf/T in range(4,W)) + for(var/turf/T in range(5, W)) turfs_to_fix |= T - clear_out_turfs(turfs_to_fix, by_type[/obj/warp_beacon]) + return turfs_to_fix proc/get_ptl_beams() . = list() @@ -513,7 +512,7 @@ ABSTRACT_TYPE(/datum/terrainify) station_repair.clean_up_station_level(params["vehicle"] & TERRAINIFY_VEHICLE_CARS, params["vehicle"] & TERRAINIFY_VEHICLE_FABS, FALSE) - log_terrainify( "turned space into an THE VOID.") + log_terrainify(user, "turned space into an THE VOID.") /proc/generate_void(all_z_levels = FALSE) station_repair.ambient_light = new /image/ambient @@ -579,6 +578,7 @@ ABSTRACT_TYPE(/datum/terrainify) // Path to market does not need to be cleared because it was converted to ice. Abyss will screw up everything! var/list/turf/traveling_crate_turfs = station_repair.get_turfs_to_fix() + traveling_crate_turfs += station_repair.get_beacon_turfs() for(var/turf/space/T in traveling_crate_turfs) T.ReplaceWith(/turf/unsimulated/floor/arctic/snow/ice) if(station_repair.allows_vehicles) @@ -624,6 +624,7 @@ ABSTRACT_TYPE(/datum/terrainify) LG.lava_percent = 25 var/list/turf/traveling_crate_turfs = station_repair.get_turfs_to_fix() + traveling_crate_turfs += station_repair.get_beacon_turfs() for(var/turf/space/T in traveling_crate_turfs) T.ReplaceWith(/turf/unsimulated/floor/auto/iomoon) if(station_repair.allows_vehicles) @@ -734,6 +735,7 @@ ABSTRACT_TYPE(/datum/terrainify) station_repair.clean_up_station_level(params["vehicle"] & TERRAINIFY_VEHICLE_CARS, params["vehicle"] & TERRAINIFY_VEHICLE_FABS) var/list/turf/traveling_crate_turfs = station_repair.get_turfs_to_fix() + traveling_crate_turfs += station_repair.get_beacon_turfs() for(var/turf/unsimulated/wall/setpieces/martian/auto/T in traveling_crate_turfs) T.ReplaceWith(/turf/unsimulated/floor/setpieces/martian/station_duststorm, force=TRUE) if(station_repair.allows_vehicles) @@ -943,6 +945,7 @@ ABSTRACT_TYPE(/datum/terrainify) generator.generate_map() var/list/turf/turfs_to_clear = station_repair.get_turfs_to_fix() + turfs_to_clear += station_repair.get_beacon_turfs() generator.clear_walls(turfs_to_clear) generator.generate_terrain(space, reuse_seed=TRUE, flags=MAPGEN_ALLOW_VEHICLES * station_repair.allows_vehicles) diff --git a/code/modules/worldgen/mapgen/RoomMaze.dm b/code/modules/worldgen/mapgen/RoomMaze.dm index bde01fe363c09..6e2944a6e6800 100644 --- a/code/modules/worldgen/mapgen/RoomMaze.dm +++ b/code/modules/worldgen/mapgen/RoomMaze.dm @@ -166,8 +166,10 @@ min_y = room_a.y + room_a.height * 0.5 + rand(-range, range) max_y = min_y + prob(15) - if(max_x == src.gen_max_x || max_y == src.gen_max_y ) - max_x = max_x + if(min_x < 0) min_x = 0 + if(min_y < 0) min_y = 0 + if(max_x > src.gen_max_x) max_x = src.gen_max_x + if(max_y > src.gen_max_y) max_y = src.gen_max_y for(var/i in min_x to max_x) for(var/j in min_y to max_y) diff --git a/code/turf/floors_unsimulated.dm b/code/turf/floors_unsimulated.dm index 5ebb3f1710ffd..768ed136908f9 100644 --- a/code/turf/floors_unsimulated.dm +++ b/code/turf/floors_unsimulated.dm @@ -1131,19 +1131,20 @@ TYPEINFO(/turf/unsimulated/floor/auto) var/connectdir = get_connected_directions_bitflag(list(src.type=TRUE), list(), TRUE, FALSE) for (var/direction in alldirs) var/turf/T = get_step(src, turn(direction, 180)) - if (istype(T, /turf/unsimulated/floor/auto)) - var/turf/unsimulated/floor/auto/TA = T - if (TA.edge_priority_level >= src.edge_priority_level) - T.ClearSpecificOverlays("edge_[direction]") // Cull overlaps + if(T) + if (istype(T, /turf/unsimulated/floor/auto)) + var/turf/unsimulated/floor/auto/TA = T + if (TA.edge_priority_level >= src.edge_priority_level) + T.ClearSpecificOverlays("edge_[direction]") // Cull overlaps + continue + if(turn(direction, 180) & connectdir) + T.ClearSpecificOverlays("edge_[direction]") // Cull diagnals continue - if(turn(direction, 180) & connectdir) - T.ClearSpecificOverlays("edge_[direction]") // Cull diagnals - continue - var/image/edge_overlay = image(src.icon, "[icon_state_edge][direction]") - edge_overlay.appearance_flags = PIXEL_SCALE | TILE_BOUND | RESET_COLOR | RESET_ALPHA - edge_overlay.layer = src.layer + (src.edge_priority_level / 1000) - edge_overlay.plane = PLANE_FLOOR - T.UpdateOverlays(edge_overlay, "edge_[direction]") + var/image/edge_overlay = image(src.icon, "[icon_state_edge][direction]") + edge_overlay.appearance_flags = PIXEL_SCALE | TILE_BOUND | RESET_COLOR | RESET_ALPHA + edge_overlay.layer = src.layer + (src.edge_priority_level / 1000) + edge_overlay.plane = PLANE_FLOOR + T.UpdateOverlays(edge_overlay, "edge_[direction]") /turf/unsimulated/floor/auto/grass/swamp_grass name = "swamp grass"