From f22e8a5b6f7e40bf92eda789784c9b1f86d30291 Mon Sep 17 00:00:00 2001 From: AllyTally Date: Wed, 20 Dec 2023 20:34:07 -0400 Subject: [PATCH] Fix resizing the map not changing the current room If you're in (5, 5) (1-indexed) and you resize the map to (4,5), the editor stays in (5, 5). This has no real consequences, other than possibly confusing the user, but it should probably be fixed anyway. --- desktop_version/src/Editor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/desktop_version/src/Editor.cpp b/desktop_version/src/Editor.cpp index 5266eb89..5020999e 100644 --- a/desktop_version/src/Editor.cpp +++ b/desktop_version/src/Editor.cpp @@ -3261,6 +3261,14 @@ void editorinput(void) cl.mapwidth = SDL_clamp(cl.mapwidth, 1, cl.maxwidth); cl.mapheight = SDL_clamp(cl.mapheight, 1, cl.maxheight); + ed.updatetiles = true; + ed.changeroom = true; + graphics.backgrounddrawn = false; + graphics.foregrounddrawn = false; + + ed.levx = POS_MOD(ed.levx, cl.mapwidth); + ed.levy = POS_MOD(ed.levy, cl.mapheight); + char buffer[3 * SCREEN_WIDTH_CHARS + 1]; vformat_buf( buffer, sizeof(buffer),