remove redundant loop in ruin placement (#29676)

This commit is contained in:
warriorstar-orion
2025-07-05 17:00:49 -04:00
committed by GitHub
parent 708b2fcb44
commit 69ce6aee7f
+1 -10
View File
@@ -64,13 +64,12 @@
bottom_left.y_pos -= padding
top_right.x_pos += padding
top_right.y_pos += padding
var/list/affected_turfs = block(bottom_left.x_pos, bottom_left.y_pos, z_level, top_right.x_pos, top_right.y_pos, z_level)
// One sanity check just in case
if(!ruin.fits_in_map_bounds(central_turf, centered = TRUE))
valid = FALSE
for(var/turf/check in affected_turfs)
for(var/turf/check in block(bottom_left.x_pos, bottom_left.y_pos, z_level, top_right.x_pos, top_right.y_pos, z_level))
var/area/new_area = get_area(check)
if(!(istype(new_area, area_whitelist)) || check.flags & NO_RUINS)
valid = FALSE
@@ -79,14 +78,6 @@
if(!valid)
continue
for(var/turf/T in affected_turfs)
for(var/obj/structure/spawner/nest in T)
qdel(nest)
for(var/mob/living/simple_animal/monster in T)
qdel(monster)
for(var/obj/structure/flora/ash/plant in T)
qdel(plant)
var/loaded = ruin.load(central_turf, centered = TRUE)
if(!loaded)
stack_trace("ruin [ruin.suffix] failed to load at [COORD(central_turf)] after valid bounds check")