From c5bb0a91f1fa0124f2f85df95071e52b309e3a95 Mon Sep 17 00:00:00 2001 From: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Thu, 25 May 2023 04:56:20 -0300 Subject: [PATCH] Don't snap Automap to player upon opening it with Follow Mode off (#1078) * Don't always snap Automap to player upon opening * Set `automapfirststart = true` in `AM_LevelInit()` * Make `automapfirststart` static --- src/am_map.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index fad743a0..7122e04e 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -238,6 +238,7 @@ int ddt_cheating = 0; // killough 2/7/98: make global, rename to ddt_* int automap_grid = 0; boolean automapactive = false; +static boolean automapfirststart = true; overlay_t automapoverlay = overlay_off; @@ -581,8 +582,13 @@ void AM_initVariables(void) m_h = FTOM(f_h); plr = &players[displayplayer]; - m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2; - m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2; + // [Alaux] Don't always snap back to player when reopening the Automap + if (followplayer || automapfirststart) + { + m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2; + m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2; + automapfirststart = false; + } AM_Ticker(); // initialize variables for interpolation AM_changeWindowLoc(); @@ -670,6 +676,8 @@ void AM_LevelInit(void) // [crispy] Only need to precalculate color lookup tables once static int precalc_once; + automapfirststart = true; + f_x = f_y = 0; // killough 2/7/98: get rid of finit_ vars