Fix #457 and another bug I just realised in one fell swoop.

That is to say, MV_PERFECT can be applied in singleplayer, but that doesn't update your best rings on the map in record attack, so the thing being yellow doesn't make sense if your rings are (none). Therefore, make it a two-flag, two-bit process.
This commit is contained in:
toaster 2019-12-05 09:47:29 +00:00
parent e6f1b82cc4
commit 2b5957fd1c
3 changed files with 8 additions and 3 deletions

View File

@ -466,7 +466,8 @@ extern recorddata_t *mainrecords[NUMMAPS];
#define MV_ALLEMERALDS 4
#define MV_ULTIMATE 8
#define MV_PERFECT 16
#define MV_MAX 31 // used in gamedata check
#define MV_PERFECTRA 32
#define MV_MAX 63 // used in gamedata check, update whenever MV's are added
#define MV_MP 128
extern UINT8 mapvisited[NUMMAPS];

View File

@ -3233,9 +3233,13 @@ static void G_UpdateVisited(void)
// eh, what the hell
if (ultimatemode)
mapvisited[gamemap-1] |= MV_ULTIMATE;
// may seem incorrect but IS possible in what the main game uses as special stages, and nummaprings will be -1 in NiGHTS
// may seem incorrect but IS possible in what the main game uses as mp special stages, and nummaprings will be -1 in NiGHTS
if (nummaprings > 0 && players[consoleplayer].rings >= nummaprings)
{
mapvisited[gamemap-1] |= MV_PERFECT;
if (modeattacking)
mapvisited[gamemap-1] |= MV_PERFECTRA;
}
if (!spec)
{
// not available to special stages because they can only really be done in one order in an unmodified game, so impossible for first six and trivial for seventh

View File

@ -9233,7 +9233,7 @@ void M_DrawTimeAttackMenu(void)
V_DrawString(104-72, 73+lsheadingheight/2, V_YELLOWMAP, "RINGS:");
V_DrawRightAlignedString(104+64, 73+lsheadingheight/2, V_ALLOWLOWERCASE|((mapvisited[cv_nextmap.value-1] & MV_PERFECT) ? V_YELLOWMAP : 0), beststr);
V_DrawRightAlignedString(104+64, 73+lsheadingheight/2, V_ALLOWLOWERCASE|((mapvisited[cv_nextmap.value-1] & MV_PERFECTRA) ? V_YELLOWMAP : 0), beststr);
V_DrawRightAlignedString(104+72, 83+lsheadingheight/2, V_ALLOWLOWERCASE, reqrings);
}