Merge branch 'record-attack-changes' into v1.2-frankeinstein

This commit is contained in:
Latapostrophe 2020-03-10 20:27:00 +01:00
commit 81ad772a8b
6 changed files with 32 additions and 11 deletions

View file

@ -2691,11 +2691,17 @@ static void Command_Pause(void)
if (cv_pause.value || server || (IsPlayerAdmin(consoleplayer)))
{
if (!paused && (modeattacking || !(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS)))
if (!paused && (!(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS)))
{
CONS_Printf(M_GetText("You can't pause here.\n"));
return;
}
else if (modeattacking) // in time attack, pausing restarts the map
{
M_ModeAttackRetry(0); // directly call from m_menu;
return;
}
SendNetXCmd(XD_PAUSE, &buf, 2);
}
else

View file

@ -2319,6 +2319,12 @@ void G_Ticker(boolean run)
UINT32 i;
INT32 buf;
ticcmd_t *cmd;
UINT32 ra_timeskip = (modeattacking && !demo.playback && leveltime < starttime - TICRATE*4) ? 0 : (starttime - TICRATE*4 - 1);
// starttime - TICRATE*4 is where we want RA to start when we PLAY IT, so we will loop the main thinker on RA start to get it to this point,
// the reason this is done is to ensure that ghosts won't look out of synch with other map elements (objects, moving platforms...)
// when we REPLAY, don't skip, let the camera spin, do its thing etc~
// also the -1 is to ensure that the thinker runs in the loop below.
P_MapStart();
// do player reborns if needed
@ -2391,12 +2397,16 @@ void G_Ticker(boolean run)
switch (gamestate)
{
case GS_LEVEL:
if (demo.title)
F_TitleDemoTicker();
P_Ticker(run); // tic the game
ST_Ticker();
AM_Ticker();
HU_Ticker();
for (; ra_timeskip < starttime - TICRATE*4; ra_timeskip++) // this looks weird but this is done to not break compability with older demos for now.
{
if (demo.title)
F_TitleDemoTicker();
P_Ticker(run); // tic the game
ST_Ticker();
AM_Ticker();
HU_Ticker();
}
break;
case GS_INTERMISSION:

View file

@ -231,7 +231,6 @@ static void M_HandleStaffReplay(INT32 choice);
static void M_ReplayTimeAttack(INT32 choice);
static void M_ChooseTimeAttack(INT32 choice);
//static void M_ChooseNightsAttack(INT32 choice);
static void M_ModeAttackRetry(INT32 choice);
static void M_ModeAttackEndGame(INT32 choice);
static void M_SetGuestReplay(INT32 choice);
//static void M_ChoosePlayer(INT32 choice);
@ -8259,7 +8258,7 @@ static void M_SetGuestReplay(INT32 choice)
which(0);
}
static void M_ModeAttackRetry(INT32 choice)
void M_ModeAttackRetry(INT32 choice)
{
(void)choice;
G_CheckDemoStatus(); // Cancel recording

View file

@ -57,6 +57,9 @@ void M_SortServerList(void);
// Draws a box with a texture inside as background for messages
void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines);
// Used in d_netcmd to restart time attack
void M_ModeAttackRetry(INT32 choice);
// the function to show a message box typing with the string inside
// string must be static (not in the stack)
// routine is a function taking a INT32 in parameter

View file

@ -691,7 +691,10 @@ void P_Ticker(boolean run)
if (run)
leveltime++;
timeinmap++;
// as this is mostly used for HUD stuff, add the record attack specific hack to it as well!
if (!(modeattacking && !demo.playback) || leveltime >= starttime - TICRATE*4)
timeinmap++;
/*if (G_TagGametype())
P_DoTagStuff();

View file

@ -7657,7 +7657,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
const INT32 timeovercam = max(0, min(180, (player->kartstuff[k_timeovercam] - 2*TICRATE)*15));
camrotate += timeovercam;
}
else if (leveltime < introtime) // Whoooshy camera!
else if (leveltime < introtime && !(modeattacking && !demo.playback)) // Whoooshy camera! (don't do this in RA when we PLAY, still do it in replays however~)
{
const INT32 introcam = (introtime - leveltime);
camrotate += introcam*5;