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
This commit is contained in:
Alaux 2023-05-25 04:56:20 -03:00 committed by GitHub
parent 9c361a0043
commit c5bb0a91f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -238,6 +238,7 @@ int ddt_cheating = 0; // killough 2/7/98: make global, rename to ddt_*
int automap_grid = 0; int automap_grid = 0;
boolean automapactive = false; boolean automapactive = false;
static boolean automapfirststart = true;
overlay_t automapoverlay = overlay_off; overlay_t automapoverlay = overlay_off;
@ -581,8 +582,13 @@ void AM_initVariables(void)
m_h = FTOM(f_h); m_h = FTOM(f_h);
plr = &players[displayplayer]; plr = &players[displayplayer];
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2; // [Alaux] Don't always snap back to player when reopening the Automap
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2; 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_Ticker(); // initialize variables for interpolation
AM_changeWindowLoc(); AM_changeWindowLoc();
@ -670,6 +676,8 @@ void AM_LevelInit(void)
// [crispy] Only need to precalculate color lookup tables once // [crispy] Only need to precalculate color lookup tables once
static int precalc_once; static int precalc_once;
automapfirststart = true;
f_x = f_y = 0; f_x = f_y = 0;
// killough 2/7/98: get rid of finit_ vars // killough 2/7/98: get rid of finit_ vars