next level key also skips the current demo (#268)

* next level key also skips the current demo

* reset demoskip variable
This commit is contained in:
Roman Fomin 2021-09-02 15:11:22 +07:00 committed by GitHub
parent 520b13cc14
commit 070cb84a41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -243,6 +243,8 @@ extern boolean timingdemo;
extern boolean fastdemo;
// [FG] fast-forward demo to the desired map
extern int demowarp;
// fast-forward demo to the next map
extern boolean demoskip;
extern gamestate_t gamestate;

View File

@ -5004,7 +5004,13 @@ boolean M_Responder (event_t* ev)
}
if (ch != 0 && ch == key_menu_nextlevel)
{
if (G_GotoNextLevel())
if (demoplayback && singledemo && !demoskip)
{
demoskip = true;
I_EnableWarp(true);
return true;
}
else if (G_GotoNextLevel())
return true;
}
}

View File

@ -1413,6 +1413,8 @@ static boolean P_LoadReject(int lumpnum, int totallines)
// [FG] current map lump number
int maplumpnum = -1;
// fast-forward demo to the next map
boolean demoskip = false;
void P_SetupLevel(int episode, int map, int playermask, skill_t skill)
{
@ -1431,10 +1433,11 @@ void P_SetupLevel(int episode, int map, int playermask, skill_t skill)
players[consoleplayer].viewz = 1;
// [FG] fast-forward demo to the desired map
if (demowarp == map)
if (demowarp == map || demoskip)
{
I_EnableWarp(false);
demowarp = -1;
demoskip = false;
}
// Make sure all sounds are stopped before Z_FreeTags.