From 7f4f6cea80880e9955c2c1734f3238f3d66f0d86 Mon Sep 17 00:00:00 2001 From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:08:27 -0700 Subject: [PATCH] Fixes TGM maploading not respecting upper_y crops (#77495) ## About The Pull Request I think I forgot how the numbers worked here, seems that way at least given how the DMM stuff looks Closes #77482 Thanks to itsmeow for pointing this out Oh also fixes tgm using maxx for the y comp. it should never actually matter but yaknow just in case --- code/modules/mapping/reader.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mapping/reader.dm b/code/modules/mapping/reader.dm index a1ef04e204f..96b555457d7 100644 --- a/code/modules/mapping/reader.dm +++ b/code/modules/mapping/reader.dm @@ -330,7 +330,7 @@ var/relative_y = first_column.ycrd var/highest_y = relative_y + y_relative_to_absolute - if(!cropMap && highest_y > world.maxx) + if(!cropMap && highest_y > world.maxy) if(new_z) // Need to avoid improperly loaded area/turf_contents world.increaseMaxY(highest_y, max_zs_to_load = z_offset - 1) @@ -343,7 +343,7 @@ var/y_skip_above = min(world.maxy - y_relative_to_absolute, y_upper, relative_y) // How many lines to skip because they'd be above the y cuttoff line var/y_starting_skip = relative_y - y_skip_above - highest_y += y_starting_skip + highest_y -= y_starting_skip // Y is the LOWEST it will ever be here, so we can easily set a threshold for how low to go