mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-15 06:01:09 +00:00
Play intermission after net replays
This commit is contained in:
parent
e76e3f2281
commit
71d1d10ef6
3 changed files with 32 additions and 10 deletions
|
@ -4919,7 +4919,7 @@ void TryRunTics(tic_t realtics)
|
||||||
|
|
||||||
if (demoplayback)
|
if (demoplayback)
|
||||||
{
|
{
|
||||||
neededtic = gametic + (realtics * cv_playbackspeed.value);
|
neededtic = gametic + realtics * (gamestate == GS_LEVEL ? cv_playbackspeed.value : 1);
|
||||||
// start a game after a demo
|
// start a game after a demo
|
||||||
maketic += realtics;
|
maketic += realtics;
|
||||||
firstticstosend = maketic;
|
firstticstosend = maketic;
|
||||||
|
|
27
src/g_game.c
27
src/g_game.c
|
@ -3589,6 +3589,8 @@ static void G_DoCompleted(void)
|
||||||
|
|
||||||
S_StopSounds();
|
S_StopSounds();
|
||||||
|
|
||||||
|
if (demoplayback) goto demointermission;
|
||||||
|
|
||||||
prevmap = (INT16)(gamemap-1);
|
prevmap = (INT16)(gamemap-1);
|
||||||
|
|
||||||
// go to next level
|
// go to next level
|
||||||
|
@ -3693,12 +3695,15 @@ static void G_DoCompleted(void)
|
||||||
nextmap = G_RandMap(G_TOLFlag(gametype), prevmap, false, 0, false, NULL);
|
nextmap = G_RandMap(G_TOLFlag(gametype), prevmap, false, 0, false, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// We are committed to this map now.
|
// We are committed to this map now.
|
||||||
// We may as well allocate its header if it doesn't exist
|
// We may as well allocate its header if it doesn't exist
|
||||||
// (That is, if it's a real map)
|
// (That is, if it's a real map)
|
||||||
if (nextmap < NUMMAPS && !mapheaderinfo[nextmap])
|
if (nextmap < NUMMAPS && !mapheaderinfo[nextmap])
|
||||||
P_AllocMapHeader(nextmap);
|
P_AllocMapHeader(nextmap);
|
||||||
|
|
||||||
|
demointermission:
|
||||||
|
|
||||||
if (skipstats && !modeattacking) // Don't skip stats if we're in record attack
|
if (skipstats && !modeattacking) // Don't skip stats if we're in record attack
|
||||||
G_AfterIntermission();
|
G_AfterIntermission();
|
||||||
else
|
else
|
||||||
|
@ -3713,6 +3718,12 @@ void G_AfterIntermission(void)
|
||||||
HU_ClearCEcho();
|
HU_ClearCEcho();
|
||||||
//G_NextLevel();
|
//G_NextLevel();
|
||||||
|
|
||||||
|
if (demoplayback)
|
||||||
|
{
|
||||||
|
G_StopDemo();
|
||||||
|
D_StartTitle();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (modeattacking) // End the run.
|
if (modeattacking) // End the run.
|
||||||
{
|
{
|
||||||
M_EndModeAttackRun();
|
M_EndModeAttackRun();
|
||||||
|
@ -4782,8 +4793,6 @@ void G_ReadDemoExtraData(void)
|
||||||
K_CheckBumpers(); // SRB2Kart
|
K_CheckBumpers(); // SRB2Kart
|
||||||
else if (G_RaceGametype())
|
else if (G_RaceGametype())
|
||||||
P_CheckRacers(); // also SRB2Kart
|
P_CheckRacers(); // also SRB2Kart
|
||||||
|
|
||||||
CONS_Printf("Change state @ %d\n", leveltime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6892,12 +6901,18 @@ boolean G_CheckDemoStatus(void)
|
||||||
{
|
{
|
||||||
if (singledemo)
|
if (singledemo)
|
||||||
I_Quit();
|
I_Quit();
|
||||||
G_StopDemo();
|
|
||||||
|
|
||||||
if (modeattacking)
|
if (multiplayer)
|
||||||
M_EndModeAttackRun();
|
G_ExitLevel();
|
||||||
else
|
else
|
||||||
D_AdvanceDemo();
|
{
|
||||||
|
G_StopDemo();
|
||||||
|
|
||||||
|
if (modeattacking)
|
||||||
|
M_EndModeAttackRun();
|
||||||
|
else
|
||||||
|
D_AdvanceDemo();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -360,7 +360,7 @@ void Y_IntermissionDrawer(void)
|
||||||
else
|
else
|
||||||
hilicol = ((intertype == int_race) ? V_SKYMAP : V_REDMAP);
|
hilicol = ((intertype == int_race) ? V_SKYMAP : V_REDMAP);
|
||||||
|
|
||||||
if (sorttic != -1 && intertic > sorttic)
|
if (sorttic != -1 && intertic > sorttic && !demoplayback)
|
||||||
{
|
{
|
||||||
INT32 count = (intertic - sorttic);
|
INT32 count = (intertic - sorttic);
|
||||||
|
|
||||||
|
@ -540,9 +540,16 @@ void Y_IntermissionDrawer(void)
|
||||||
dotimer:
|
dotimer:
|
||||||
if (timer)
|
if (timer)
|
||||||
{
|
{
|
||||||
|
char *string;
|
||||||
INT32 tickdown = (timer+1)/TICRATE;
|
INT32 tickdown = (timer+1)/TICRATE;
|
||||||
|
|
||||||
|
if (multiplayer && demoplayback)
|
||||||
|
string = va("Replay ends in %d", tickdown);
|
||||||
|
else
|
||||||
|
string = va("%s starts in %d", cv_advancemap.string, tickdown);
|
||||||
|
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol,
|
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol,
|
||||||
va("%s starts in %d", cv_advancemap.string, tickdown));
|
string);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make it obvious that scrambling is happening next round.
|
// Make it obvious that scrambling is happening next round.
|
||||||
|
@ -603,7 +610,7 @@ void Y_Ticker(void)
|
||||||
{
|
{
|
||||||
if (sorttic == -1)
|
if (sorttic == -1)
|
||||||
sorttic = intertic + max((cv_inttime.value/2)-2, 2)*TICRATE; // 8 second pause after match results
|
sorttic = intertic + max((cv_inttime.value/2)-2, 2)*TICRATE; // 8 second pause after match results
|
||||||
else
|
else if (!(multiplayer && demoplayback)) // Don't advance to rankings in replays
|
||||||
{
|
{
|
||||||
if (!data.match.rankingsmode && (intertic >= sorttic + 8))
|
if (!data.match.rankingsmode && (intertic >= sorttic + 8))
|
||||||
Y_CalculateMatchData(1, Y_CompareRank);
|
Y_CalculateMatchData(1, Y_CompareRank);
|
||||||
|
|
Loading…
Reference in a new issue