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.
This commit is contained in:
AllyTally authored and Misa Elizabeth Kai committed 2023-12-24 12:36:16 -08:00
1 parent a97ba5e768
commit 1d130acc20
1 file changed
+8
+8
View File
@@ -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),