- fixed a few things.

Basic level progression is working, special cases still need testing, but for now it's good enough.
This commit is contained in:
Christoph Oelckers 2020-07-07 21:38:20 +02:00
parent 01fce31f43
commit 63eaec916b
5 changed files with 34 additions and 6 deletions

View file

@ -173,7 +173,7 @@ bool cheatStuff(cheatseq_t *)
static bool cheatLevel(cheatseq_t *s)
{
// Fixme: This should be broadcast as a net event once things are up again.
g_lastLevel = 0;
lastlevel = 0;
int volnume,levnume;
volnume = s->Args[0] - '0' - 1;
levnume = (s->Args[1] - '0')*10+(s->Args[2]-'0') - 1;
@ -261,7 +261,7 @@ static bool cheatCashman(cheatseq_t *)
static bool cheatSkill(cheatseq_t *s)
{
g_lastLevel = 0;
lastlevel = 0;
ud.m_player_skill = ud.player_skill = s->Args[0] - '1';
ps[myconnectindex].gm |= MODE_RESTART;
FX_StopAllSounds();

View file

@ -788,12 +788,12 @@ int parsecommand()
tempMusic.Reserve(1);
tempMusic.Last().levnum = levelnum(k, i);
tempMusic.Last().music = parsebuffer.Data();
textptr += j;
}
else
{
specialmusic.Push(parsebuffer.Data());
}
textptr += j;
i++;
}
@ -1728,6 +1728,34 @@ void loadcons(const char* filenam)
auto map = FindMapByLevelNum(tm.levnum);
if (map) map->music = tm.music;
}
if (isRRRA())
{
// RRRA goes directly to the second episode after E1L7 to continue the game.
int num = fileSystem.CheckNumForName("e1l7.map");
int file = fileSystem.GetFileContainer(num);
if (file <= fileSystem.GetMaxIwadNum())
{
auto maprec = FindMapByName("e1l7");
if (maprec) maprec->nextLevel = levelnum(1, 0);
}
}
else if (isRR())
{
// RR does not define its final level and crudely hacked it into the progression. This puts it into the E2L8 slot so that the game can naturally progress there.
auto maprec1 = FindMapByLevelNum(levelnum(1, 6));
auto maprec2 = FindMapByLevelNum(levelnum(1, 7));
auto maprec3 = FindMapByName("endgame");
int num3 = fileSystem.CheckNumForName("endgame.map");
if (maprec1 && !maprec2 && !maprec3 && num3 >= 0)
{
auto maprec = AllocateMap();
maprec->designerTime = 0;
maprec->parTime = 0;
maprec->SetFileName("endgame.map");
maprec->SetName("$TXT_CLOSEENCOUNTERS");
maprec->levelNumber = levelnum(1, 7);
}
}
tempMusic.Clear();
}

View file

@ -967,7 +967,8 @@ int exitlevel(void)
if (ps[myconnectindex].gm & MODE_RESTART)
{
ud.nextLevel = currentLevel;
// If no level was set, restart the current one.
if (!ud.nextLevel) ud.nextLevel = currentLevel;
}
if (ps[myconnectindex].gm & MODE_EOL)

View file

@ -94,7 +94,7 @@ void G_NewGame(MapRecord *map, int skillNum)
int const UserMap = false;// Menu_HaveUserMap();
// we don't want the intro to play after the multiplayer setup screen.
if (!isRR() && (!g_netServer && ud.multimode < 2) && UserMap == 0 && currentLevel->levelNumber == levelnum(3, 0))
if (!isRR() && (!g_netServer && ud.multimode < 2) && UserMap == 0 && map->levelNumber == levelnum(3, 0))
{
e4intro([](bool) {});
}

View file

@ -2241,7 +2241,6 @@ static void G_FadeLoad(int32_t r, int32_t g, int32_t b, int32_t start, int32_t e
int G_EnterLevel(int gameMode)
{
int32_t i, mii;
char levelName[BMAX_PATH];
// flushpackets();
// waitforeverybody();