Redid that ridiculous lastcoop thing as an MV_MP thing, which also means it gets properly cleared when you load mods with new save data.

This commit is contained in:
toasterbabe 2017-09-15 20:34:46 +01:00
parent b217e9eb92
commit 970268ec38
4 changed files with 19 additions and 23 deletions

View File

@ -44,7 +44,6 @@ extern INT32 cursaveslot;
//extern INT16 lastmapsaved; //extern INT16 lastmapsaved;
extern INT16 lastmaploaded; extern INT16 lastmaploaded;
extern boolean gamecomplete; extern boolean gamecomplete;
extern INT16 lastcoop;
#define PRECIP_NONE 0 #define PRECIP_NONE 0
#define PRECIP_STORM 1 #define PRECIP_STORM 1
@ -375,6 +374,7 @@ extern recorddata_t *mainrecords[NUMMAPS];
#define MV_ULTIMATE 8 #define MV_ULTIMATE 8
#define MV_PERFECT 16 #define MV_PERFECT 16
#define MV_MAX 31 // used in gamedata check #define MV_MAX 31 // used in gamedata check
#define MV_MP 128
extern UINT8 mapvisited[NUMMAPS]; extern UINT8 mapvisited[NUMMAPS];
// Temporary holding place for nights data for the current map // Temporary holding place for nights data for the current map

View File

@ -80,7 +80,6 @@ INT32 cursaveslot = -1; // Auto-save 1p savegame slot
//INT16 lastmapsaved = 0; // Last map we auto-saved at //INT16 lastmapsaved = 0; // Last map we auto-saved at
INT16 lastmaploaded = 0; // Last map the game loaded INT16 lastmaploaded = 0; // Last map the game loaded
boolean gamecomplete = false; boolean gamecomplete = false;
INT16 lastcoop = 0;
UINT16 mainwads = 0; UINT16 mainwads = 0;
boolean modifiedgame; // Set if homebrew PWAD stuff has been added. boolean modifiedgame; // Set if homebrew PWAD stuff has been added.
@ -3385,7 +3384,7 @@ void G_SaveGameData(void)
// TODO put another cipher on these things? meh, I don't care... // TODO put another cipher on these things? meh, I don't care...
for (i = 0; i < NUMMAPS; i++) for (i = 0; i < NUMMAPS; i++)
WRITEUINT8(save_p, mapvisited[i]); WRITEUINT8(save_p, (mapvisited[i] & MV_MAX));
// To save space, use one bit per collected/achieved/unlocked flag // To save space, use one bit per collected/achieved/unlocked flag
for (i = 0; i < MAXEMBLEMS;) for (i = 0; i < MAXEMBLEMS;)

View File

@ -3827,24 +3827,22 @@ static boolean M_LevelAvailableOnPlatter(INT32 mapnum)
switch (levellistmode) switch (levellistmode)
{ {
case LLM_CREATESERVER: case LLM_CREATESERVER:
if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED) if (!(mapheaderinfo[mapnum]->typeoflevel & TOL_COOP))
return true; return true;
if (!mapvisited[mapnum] if (mapvisited[mapnum]) // MV_MP
&& (mapheaderinfo[mapnum]->typeoflevel & TOL_COOP)
&& (mapnum+1) > lastcoop)
return false;
return true;
case LLM_RECORDATTACK:
case LLM_NIGHTSATTACK:
if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED)
return true; return true;
if (!mapvisited[mapnum])
return false;
// intentional fallthrough // intentional fallthrough
case LLM_RECORDATTACK:
case LLM_NIGHTSATTACK:
if (mapvisited[mapnum] & MV_MAX)
return true;
if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED)
return true;
return false;
case LLM_LEVELSELECT: case LLM_LEVELSELECT:
default: default:
return true; return true;
@ -5598,7 +5596,7 @@ static void M_DrawChecklist(void)
if (title) if (title)
{ {
const char *level = ((M_MapLocked(cond[condnum].requirement) || !((mapheaderinfo[cond[condnum].requirement-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].requirement-1])) ? M_CreateSecretMenuOption(title) : title); const char *level = ((M_MapLocked(cond[condnum].requirement) || !((mapheaderinfo[cond[condnum].requirement-1]->menuflags & LF2_NOVISITNEEDED) || (mapvisited[cond[condnum].requirement-1] & MV_MAX))) ? M_CreateSecretMenuOption(title) : title);
switch (cond[condnum].type) switch (cond[condnum].type)
{ {
@ -5631,7 +5629,7 @@ static void M_DrawChecklist(void)
if (title) if (title)
{ {
const char *level = ((M_MapLocked(cond[condnum].extrainfo1) || !((mapheaderinfo[cond[condnum].extrainfo1-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].extrainfo1-1])) ? M_CreateSecretMenuOption(title) : title); const char *level = ((M_MapLocked(cond[condnum].extrainfo1) || !((mapheaderinfo[cond[condnum].extrainfo1-1]->menuflags & LF2_NOVISITNEEDED) || (mapvisited[cond[condnum].extrainfo1-1] & MV_MAX))) ? M_CreateSecretMenuOption(title) : title);
switch (cond[condnum].type) switch (cond[condnum].type)
{ {
@ -5700,7 +5698,7 @@ static void M_DrawChecklist(void)
if (title) if (title)
{ {
const char *level = ((M_MapLocked(cond[condnum].extrainfo1) || !((mapheaderinfo[cond[condnum].extrainfo1-1]->menuflags & LF2_NOVISITNEEDED) || mapvisited[cond[condnum].extrainfo1-1])) ? M_CreateSecretMenuOption(title) : title); const char *level = ((M_MapLocked(cond[condnum].extrainfo1) || !((mapheaderinfo[cond[condnum].extrainfo1-1]->menuflags & LF2_NOVISITNEEDED) || (mapvisited[cond[condnum].extrainfo1-1] & MV_MAX))) ? M_CreateSecretMenuOption(title) : title);
switch (cond[condnum].type) switch (cond[condnum].type)
{ {
@ -6786,7 +6784,7 @@ static void M_Statistics(INT32 choice)
if (!(mapheaderinfo[i]->typeoflevel & TOL_SP) || (mapheaderinfo[i]->menuflags & LF2_HIDEINSTATS)) if (!(mapheaderinfo[i]->typeoflevel & TOL_SP) || (mapheaderinfo[i]->menuflags & LF2_HIDEINSTATS))
continue; continue;
if (!mapvisited[i]) if (!(mapvisited[i] & MV_MAX))
continue; continue;
statsMapList[j++] = i; statsMapList[j++] = i;

View File

@ -3013,9 +3013,8 @@ boolean P_SetupLevel(boolean skipprecip)
if (!(netgame || multiplayer) && (!modifiedgame || savemoddata)) if (!(netgame || multiplayer) && (!modifiedgame || savemoddata))
mapvisited[gamemap-1] |= MV_VISITED; mapvisited[gamemap-1] |= MV_VISITED;
else
if ((maptol & TOL_COOP) && lastcoop < gamemap) mapvisited[gamemap-1] |= MV_MP; // you want to record that you've been there this session, but not permanently
lastcoop = gamemap;
levelloading = false; levelloading = false;