Cheat updates

- The devmode cheat returns to title screen
- The warp cheat unlocks all hidden levels
This commit is contained in:
toaster 2023-12-04 20:36:58 +00:00
parent 85d8cfdf85
commit 94a341b629

View file

@ -73,13 +73,24 @@ static UINT8 cheatf_warp(void)
{
if (!unlockables[i].conditionset)
continue;
if (!gamedata->unlocked[i])
{
gamedata->unlocked[i] = true;
success = true;
}
if (gamedata->unlocked[i])
continue;
gamedata->unlocked[i] = true;
success = true;
}
// Unlock all hidden levels.
#define GD_MV_SET (MV_VISITED|MV_BEATEN)
for (i = 0; i < nummapheaders; i++)
{
if ((mapheaderinfo[i]->records.mapvisited & GD_MV_SET) == GD_MV_SET)
continue;
mapheaderinfo[i]->records.mapvisited |= GD_MV_SET;
success = true;
}
#undef GD_MV_SET
// Goofy, but this call needs to be before M_ClearMenus because that path
// calls G_LoadLevel, which will trigger a gamedata save. Garbage factory
if (success)
@ -170,6 +181,8 @@ static UINT8 cheatf_devmode(void)
mapheaderinfo[i]->records.mapvisited = MV_MAX;
}
M_ClearMenus(true);
// This is a developer feature, you know how to delete ringdata
// G_SetUsedCheats();
S_StartSound(0, sfx_kc42);