Skip to content

Commit

Permalink
Allow map ExMy for Legacy of Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Oct 19, 2024
1 parent 956b016 commit 18a7482
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
17 changes: 17 additions & 0 deletions src/c_autocomplete.c
Original file line number Diff line number Diff line change
Expand Up @@ -6854,24 +6854,41 @@ autocomplete_t autocompletelist[] =
{ "map disunion", LEGACYOFRUSTONLY },
{ "map downtown", DOOM2ONLY },
{ "map E1M1", DOOM1ONLY },
{ "map E1M1", LEGACYOFRUSTONLY },
{ "map E1M2", DOOM1ONLY },
{ "map E1M2", LEGACYOFRUSTONLY },
{ "map E1M3", DOOM1ONLY },
{ "map E1M3", LEGACYOFRUSTONLY },
{ "map E1M4", DOOM1ONLY },
{ "map E1M4", LEGACYOFRUSTONLY },
{ "map E1M4B", DOOM1ONLY },
{ "map E1M5", DOOM1ONLY },
{ "map E1M5", LEGACYOFRUSTONLY },
{ "map E1M6", DOOM1ONLY },
{ "map E1M6", LEGACYOFRUSTONLY },
{ "map E1M7", DOOM1ONLY },
{ "map E1M7", LEGACYOFRUSTONLY },
{ "map E1M8", DOOM1ONLY },
{ "map E1M8", LEGACYOFRUSTONLY },
{ "map E1M8B", DOOM1ONLY },
{ "map E1M9", DOOM1ONLY },
{ "map E1M9", DOOM1ONLY },
{ "map E2M1", DOOM1ONLY },
{ "map E2M1", LEGACYOFRUSTONLY },
{ "map E2M2", DOOM1ONLY },
{ "map E2M2", LEGACYOFRUSTONLY },
{ "map E2M3", DOOM1ONLY },
{ "map E2M3", LEGACYOFRUSTONLY },
{ "map E2M4", DOOM1ONLY },
{ "map E2M4", LEGACYOFRUSTONLY },
{ "map E2M5", DOOM1ONLY },
{ "map E2M5", LEGACYOFRUSTONLY },
{ "map E2M6", DOOM1ONLY },
{ "map E2M6", LEGACYOFRUSTONLY },
{ "map E2M7", DOOM1ONLY },
{ "map E2M7", LEGACYOFRUSTONLY },
{ "map E2M8", DOOM1ONLY },
{ "map E2M8", LEGACYOFRUSTONLY },
{ "map E2M9", DOOM1ONLY },
{ "map E3M1", DOOM1ONLY },
{ "map E3M2", DOOM1ONLY },
Expand Down
20 changes: 18 additions & 2 deletions src/c_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -4394,7 +4394,21 @@ static bool map_func1(char *cmd, char *parms)
{
mapcmdepisode = 1;

if (sscanf(parm, "MAP0%1i", &mapcmdmap) == 1 || sscanf(parm, "MAP%2i", &mapcmdmap) == 1)
if (legacyofrust && sscanf(parm, "E%iM%i", &mapcmdepisode, &mapcmdmap) == 2)
{
char lump[6];

if (mapcmdepisode <= 2 && mapcmdmap <= 7)
mapcmdmap = (mapcmdepisode - 1) * 7 + mapcmdmap;
else if (mapcmdepisode <= 2 && mapcmdmap == 8)
mapcmdmap = 14 + mapcmdepisode;
else
mapcmdmap = 0;

M_snprintf(lump, sizeof(lump), "MAP%02i", mapcmdmap);
result = (W_CheckNumForName(lump) >= 0);
}
else if (sscanf(parm, "MAP0%1i", &mapcmdmap) == 1 || sscanf(parm, "MAP%2i", &mapcmdmap) == 1)
{
if (!((BTSX && W_GetNumLumps(parm) == 1) || (gamemission == pack_nerve && mapcmdmap > 9)))
{
Expand Down Expand Up @@ -4593,7 +4607,9 @@ static void map_func2(char *cmd, char *parms)
C_Output(buffer);
HU_SetPlayerMessage(buffer, false, false);

if (gamemode == commercial)
if (P_IsSecret(mapcmdepisode, mapcmdmap))
message_secret = true;
else if (gamemode == commercial)
{
if (mapcmdmap == 31 || mapcmdmap == 32
|| (mapcmdmap == 33 && bfgedition)
Expand Down

0 comments on commit 18a7482

Please sign in to comment.