Skip to content

Commit

Permalink
Update _MapGenerator.dm
Browse files Browse the repository at this point in the history
  • Loading branch information
Filatelele committed May 22, 2024
1 parent 56690c8 commit 2ec8ef5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions code/modules/mapgen/_MapGenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@
ruin.load(ruin_turf)

/datum/map_generator/proc/get_unused_square(z_level, tries = 5, width = 0, height = 0)
var/turf/possible_turf = locate(
rand(0 + TRANSITION_EDGE + 1, 255 - width - TRANSITION_EDGE + 1),
rand(0 + TRANSITION_EDGE + 1, 255 - height - TRANSITION_EDGE + 1),
z_level
)

for(var/i in 1 to tries)
var/turf/possible_turf = locate(
rand(0 + TRANSITION_EDGE + 1, 255 - width - TRANSITION_EDGE + 1),
rand(0 + TRANSITION_EDGE + 1, 255 - height - TRANSITION_EDGE + 1),
z_level
)

if(locate(/atom/movable) in block(locate(possible_turf.x, possible_turf.y, z_level), locate(possible_turf.x + width, possible_turf.y + height, z_level)))
continue

Expand Down

0 comments on commit 2ec8ef5

Please sign in to comment.