Code cleanup as requested by Sal and Sryder.

* majormods and savemoddata cannot coexist as true values, so going through and making situations that involve both only reference one.
* Clean up comments in `dehacked.c`.
This commit is contained in:
toaster 2019-01-26 16:58:45 +00:00
parent d045af07b1
commit 1a21c5efbe
7 changed files with 19 additions and 20 deletions

View File

@ -2209,7 +2209,7 @@ static void Command_Map_f(void)
return;
}
if (!(netgame || multiplayer) && (!majormods || savemoddata))
if (!(netgame || multiplayer) && !majormods)
{
if (COM_CheckParm("-force"))
{

View File

@ -3425,7 +3425,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
if (fastcmp(word, "FREESLOT"))
{
readfreeslots(f);
//G_SetGameModified(multiplayer, true);
// This is not a major mod.
continue;
}
else if (fastcmp(word, "MAINCFG"))
@ -3439,7 +3439,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
{
readwipes(f);
DEH_WriteUndoline(word, "", UNDO_HEADER);
//G_SetGameModified(multiplayer, true);
// This is not a major mod.
continue;
}
word2 = strtok(NULL, " ");
@ -3460,7 +3460,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
ignorelines(f);
}
DEH_WriteUndoline(word, word2, UNDO_HEADER);
//G_SetGameModified(multiplayer, true);
// This is not a major mod.
continue;
}
if (word2)
@ -3474,14 +3474,14 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
// Read texture from spec file.
readtexture(f, word2);
DEH_WriteUndoline(word, word2, UNDO_HEADER);
//G_SetGameModified(multiplayer, true);
// This is not a major mod.
}
else if (fastcmp(word, "PATCH"))
{
// Read patch from spec file.
readpatch(f, word2, wad);
DEH_WriteUndoline(word, word2, UNDO_HEADER);
//G_SetGameModified(multiplayer, true);
// This is not a major mod.
}
else if (fastcmp(word, "THING") || fastcmp(word, "MOBJ") || fastcmp(word, "OBJECT"))
{
@ -3503,7 +3503,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
/* else if (fastcmp(word, "ANIMTEX"))
{
readAnimTex(f, i);
//G_SetGameModified(multiplayer, true);
// This is not a major mod.
}*/
else if (fastcmp(word, "LIGHT"))
{
@ -3517,7 +3517,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
ignorelines(f);
}
DEH_WriteUndoline(word, word2, UNDO_HEADER);
//G_SetGameModified(multiplayer, true);
// This is not a major mod.
#endif
}
else if (fastcmp(word, "SPRITE"))
@ -3533,7 +3533,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
ignorelines(f);
}
DEH_WriteUndoline(word, word2, UNDO_HEADER);
//G_SetGameModified(multiplayer, true);
// This is not a major mod.
#endif
}
else if (fastcmp(word, "LEVEL"))
@ -3622,7 +3622,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
ignorelines(f);
}
DEH_WriteUndoline(word, word2, UNDO_HEADER);
//G_SetGameModified(multiplayer, true); -- ...this won't bite me in the ass later, will it?
// This is not a major mod.
}
/* else if (fastcmp(word, "SPRITE"))
{
@ -3643,7 +3643,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
}
else
deh_warning("Sprite %d doesn't exist",i);
//G_SetGameModified(multiplayer, true);
// This is not a major mod.
}*/
else if (fastcmp(word, "HUDITEM"))
{
@ -3657,7 +3657,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
ignorelines(f);
}
DEH_WriteUndoline(word, word2, UNDO_HEADER);
//G_SetGameModified(multiplayer, true);
// This is not a major mod.
}
else if (fastcmp(word, "EMBLEM"))
{

View File

@ -756,7 +756,7 @@ void G_SetNightsRecords(void)
// for consistency among messages: this modifies the game and removes savemoddata.
void G_SetGameModified(boolean silent, boolean major)
{
if ((majormods && modifiedgame && !savemoddata) || !mainwads || (refreshdirmenu & REFRESHDIR_GAMEDATA)) // new gamedata amnesty?
if ((majormods && modifiedgame) || !mainwads || (refreshdirmenu & REFRESHDIR_GAMEDATA)) // new gamedata amnesty?
return;
modifiedgame = true;

View File

@ -385,8 +385,7 @@ UINT8 M_UpdateUnlockablesAndExtraEmblems(boolean force)
char cechoText[992] = "";
UINT8 cechoLines = 0;
if (/*modifiedgame*/ majormods && !savemoddata
&& !force) // SRB2Kart: for enabling unlocks online in modified servers
if (majormods && !force) // SRB2Kart: for enabling unlocks online in modified servers
return false;
M_CheckUnlockConditions();

View File

@ -2738,7 +2738,7 @@ boolean M_Responder(event_t *ev)
|| (currentMenu->menuitems[itemOn].status & IT_TYPE)==IT_SUBMENU)
&& (currentMenu->menuitems[itemOn].status & IT_CALLTYPE))
{
if (((currentMenu->menuitems[itemOn].status & IT_CALLTYPE) & IT_CALL_NOTMODIFIED) && /*modifiedgame*/ majormods && !savemoddata)
if (((currentMenu->menuitems[itemOn].status & IT_CALLTYPE) & IT_CALL_NOTMODIFIED) && majormods)
{
S_StartSound(NULL, sfx_menu1);
M_StartMessage(M_GetText("This cannot be done with complex add-ons\nor in a cheated game.\n\n(Press a key)\n"), NULL, MM_NOTHING);
@ -4567,7 +4567,7 @@ static boolean M_AddonsRefresh(void)
S_StartSound(NULL, sfx_s224);
message = va("%c%s\x80\nA file was loaded with %s.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname, ((refreshdirmenu & REFRESHDIR_ERROR) ? "errors" : "warnings"));
}
else if (majormods && !prevmajormods && !savemoddata)
else if (majormods && !prevmajormods)
{
S_StartSound(NULL, sfx_s221);
message = va("%c%s\x80\nGameplay has now been modified.\nif you wish to play record attack mode, restart the game to clear existing add-ons.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname);

View File

@ -1120,7 +1120,7 @@ static inline void P_SpawnEmblems(void)
static void P_SpawnSecretItems(boolean loademblems)
{
// Now let's spawn those funky emblem things! Tails 12-08-2002
if (netgame || multiplayer || (/*modifiedgame*/ majormods && !savemoddata)) // No cheating!!
if (netgame || multiplayer || majormods) // No cheating!!
return;
if (loademblems)
@ -3272,7 +3272,7 @@ boolean P_SetupLevel(boolean skipprecip)
nextmapoverride = 0;
skipstats = false;
if (!(netgame || multiplayer) && (/*!modifiedgame*/ !majormods || savemoddata))
if (!(netgame || multiplayer) && !majormods)
mapvisited[gamemap-1] |= MV_VISITED;
levelloading = false;

View File

@ -786,7 +786,7 @@ void Y_StartIntermission(void)
}
case int_race: // (time-only race)
{
if ((/*!modifiedgame*/ !majormods || savemoddata) && !multiplayer && !demoplayback) // remove this once we have a proper time attack screen
if (!majormods && !multiplayer && !demoplayback) // remove this once we have a proper time attack screen
{
// Update visitation flags
mapvisited[gamemap-1] |= MV_BEATEN;