Skip to content

Commit abdf066

Browse files
committed
Change IDCLEV cheat for Legacy of Rust
1 parent e9bea4c commit abdf066

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

src/c_cmds.c

+18-1
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,21 @@ static bool cheat_func1(char *cmd, char *parms)
14071407
{
14081408
bool result;
14091409

1410-
if (gamemode == commercial)
1410+
if (legacyofrust)
1411+
{
1412+
mapcmdepisode = parms[0] - '0';
1413+
mapcmdmap = parms[1] - '0';
1414+
1415+
if (mapcmdepisode <= 2 && mapcmdmap <= 7)
1416+
mapcmdmap = (mapcmdepisode - 1) * 7 + mapcmdmap;
1417+
else if (mapcmdepisode <= 2 && mapcmdmap == 8)
1418+
mapcmdmap = 14 + mapcmdepisode;
1419+
else
1420+
mapcmdmap = mapcmdepisode * 10 + mapcmdmap;
1421+
1422+
M_snprintf(mapcmdlump, sizeof(mapcmdlump), "MAP%02i", mapcmdmap);
1423+
}
1424+
else if (gamemode == commercial)
14111425
{
14121426
mapcmdepisode = 1;
14131427
mapcmdmap = (parms[0] - '0') * 10 + parms[1] - '0';
@@ -1428,6 +1442,9 @@ static bool cheat_func1(char *cmd, char *parms)
14281442
return result;
14291443
else if (result)
14301444
{
1445+
if (legacyofrust && mapcmdmap != 99)
1446+
M_snprintf(mapcmdlump, sizeof(mapcmdlump), "E%cM%c", parms[0], parms[1]);
1447+
14311448
S_StartSound(NULL, sfx_getpow);
14321449
ST_PlayerCheated(cheat_clev_xy.sequence, "xy", NULL, true);
14331450
map_func2("map", mapcmdlump);

src/st_stuff.c

+18-2
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,21 @@ bool ST_Responder(const event_t *ev)
980980

981981
cht_GetParam(&cheat_clev_xy, buffer);
982982

983-
if (gamemode == commercial)
983+
if (legacyofrust)
984+
{
985+
epsd = buffer[0] - '0';
986+
map = buffer[1] - '0';
987+
988+
if (epsd <= 2 && map <= 7)
989+
map = (epsd - 1) * 7 + map;
990+
else if (epsd <= 2 && map == 8)
991+
map = 14 + epsd;
992+
else
993+
map = epsd * 10 + map;
994+
995+
M_snprintf(lump, sizeof(lump), "MAP%02i", map);
996+
}
997+
else if (gamemode == commercial)
984998
{
985999
epsd = 1;
9861000
map = (buffer[0] - '0') * 10 + buffer[1] - '0';
@@ -1008,7 +1022,9 @@ bool ST_Responder(const event_t *ev)
10081022
S_StartSound(NULL, sfx_getpow);
10091023
ST_PlayerCheated(cheat_clev_xy.sequence, "xy", NULL, true);
10101024

1011-
if (BTSX)
1025+
if (legacyofrust && map != 99)
1026+
M_snprintf(lump, sizeof(lump), "E%cM%c", buffer[0], buffer[1]);
1027+
else if (BTSX)
10121028
M_snprintf(lump, sizeof(lump), "E%iM%c%c", (BTSXE1 ? 1 : (BTSXE2 ? 2 : 3)), buffer[0], buffer[1]);
10131029

10141030
if (M_StringCompare(lump, mapnum))

0 commit comments

Comments
 (0)