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