kill redundant laptime code
just use the newer one
This commit is contained in:
1 parent
9dee892244
commit
02b411f7ee
7 files changed
+21
-40
No files matched your search
@@ -351,6 +351,7 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
LAP_CUR,
|
||||
LAP_BEST,
|
||||
LAP_LAST,
|
||||
LAP__MAX
|
||||
} laptime_e;
|
||||
|
||||
@@ -482,7 +482,6 @@ extern boolean startedInFreePlay;
|
||||
|
||||
extern boolean legitimateexit;
|
||||
extern boolean comebackshowninfo;
|
||||
extern tic_t curlap, bestlap;
|
||||
|
||||
extern INT16 votelevels[4][2];
|
||||
extern SINT8 votes[MAXPLAYERS];
|
||||
|
||||
@@ -279,8 +279,6 @@ boolean startedInFreePlay; // Map was started in free play
|
||||
// Client-sided, unsynched variables (NEVER use in anything that needs to be synced with other players)
|
||||
boolean legitimateexit; // Did this client actually finish the match?
|
||||
boolean comebackshowninfo; // Have you already seen the "ATTACK OR PROTECT" message?
|
||||
tic_t curlap; // Current lap time
|
||||
tic_t bestlap; // Best lap time
|
||||
static INT16 randmapbuffer[NUMMAPS+1]; // Buffer for maps RandMap is allowed to roll
|
||||
|
||||
tic_t hidetime;
|
||||
|
||||
+5
-1
@@ -2116,7 +2116,11 @@ static void P_LevelInitStuff(boolean reloadinggamestate)
|
||||
players[i].lives = 1; // SRB2Kart
|
||||
|
||||
players[i].realtime = racecountdown = exitcountdown = 0;
|
||||
curlap = bestlap = 0; // SRB2Kart
|
||||
|
||||
for (INT32 j = 0; j < LAP__MAX; j++)
|
||||
{
|
||||
players[i].laptime[j] = 0;
|
||||
}
|
||||
|
||||
players[i].gotcontinue = false;
|
||||
|
||||
|
||||
+2
-6
@@ -3912,17 +3912,13 @@ DoneSection2:
|
||||
CON_LogMessage(va(M_GetText("%s has finished the race.\n"), player_names[player-players]));
|
||||
|
||||
// SRB2Kart: save best lap for record attack
|
||||
if (player == &players[consoleplayer])
|
||||
if (player->laptime[LAP_CUR] < player->laptime[LAP_BEST] || player->laptime[LAP_BEST] == 0)
|
||||
{
|
||||
if (curlap < bestlap || bestlap == 0)
|
||||
bestlap = curlap;
|
||||
curlap = 0;
|
||||
player->laptime[LAP_BEST] = player->laptime[LAP_CUR];
|
||||
}
|
||||
|
||||
// ONLY FOR HUD
|
||||
player->laptime[LAP_LAST] = player->laptime[LAP_CUR];
|
||||
player->laptime[LAP_CUR] = 0;
|
||||
//
|
||||
|
||||
player->starposttime = player->realtime;
|
||||
player->starpostnum = 0;
|
||||
|
||||
+10
-27
@@ -2927,24 +2927,15 @@ static void P_DeathThink(player_t *player)
|
||||
if (leveltime >= starttime)
|
||||
{
|
||||
player->realtime = leveltime - starttime;
|
||||
if (player == &players[consoleplayer])
|
||||
{
|
||||
if (player->spectator || !circuitmap)
|
||||
curlap = 0;
|
||||
else
|
||||
curlap++; // This is too complicated to sync to realtime, just sorta hope for the best :V
|
||||
}
|
||||
|
||||
if (player->spectator)
|
||||
player->laptime[LAP_CUR] = 0;
|
||||
else
|
||||
else if (player->laptime[LAP_CUR] != UINT32_MAX)
|
||||
player->laptime[LAP_CUR]++; // This is too complicated to sync to realtime, just sorta hope for the best :V
|
||||
}
|
||||
else
|
||||
{
|
||||
player->realtime = 0;
|
||||
if (player == &players[consoleplayer])
|
||||
curlap = 0;
|
||||
|
||||
player->laptime[LAP_CUR] = 0;
|
||||
}
|
||||
@@ -4691,25 +4682,15 @@ void P_PlayerThink(player_t *player)
|
||||
if (leveltime >= starttime)
|
||||
{
|
||||
player->realtime = leveltime - starttime;
|
||||
if (player == &players[consoleplayer])
|
||||
{
|
||||
if (player->spectator || !circuitmap)
|
||||
curlap = 0;
|
||||
else
|
||||
curlap++; // This is too complicated to sync to realtime, just sorta hope for the best :V
|
||||
}
|
||||
|
||||
if (player->spectator)
|
||||
player->laptime[LAP_CUR] = 0;
|
||||
else
|
||||
else if (player->laptime[LAP_CUR] != UINT32_MAX)
|
||||
player->laptime[LAP_CUR]++; // This is too complicated to sync to realtime, just sorta hope for the best :V
|
||||
}
|
||||
else
|
||||
{
|
||||
player->realtime = 0;
|
||||
if (player == &players[consoleplayer])
|
||||
curlap = 0;
|
||||
|
||||
player->laptime[LAP_CUR] = 0;
|
||||
}
|
||||
}
|
||||
@@ -4821,21 +4802,23 @@ void P_PlayerThink(player_t *player)
|
||||
player->linkcount = 0;
|
||||
}
|
||||
|
||||
// Move around.
|
||||
// Reactiontime is used to prevent movement
|
||||
// for a bit after a teleport.
|
||||
if (player->mo->reactiontime)
|
||||
{
|
||||
// Reactiontime is used to prevent movement
|
||||
// for a bit after a teleport.
|
||||
player->mo->reactiontime--;
|
||||
}
|
||||
else if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT)
|
||||
{
|
||||
{
|
||||
P_DoZoomTube(player);
|
||||
}
|
||||
P_DoZoomTube(player);
|
||||
player->rmomx = player->rmomy = 0; // no actual momentum from your controls
|
||||
P_ResetScore(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Move around.
|
||||
P_MovePlayer(player);
|
||||
}
|
||||
|
||||
if (!player->mo)
|
||||
{
|
||||
|
||||
+3
-3
@@ -721,13 +721,13 @@ static void Y_UpdateRecordReplays(void)
|
||||
if ((mainrecords[gamemap-1]->time == 0) || (players[consoleplayer].realtime < mainrecords[gamemap-1]->time))
|
||||
mainrecords[gamemap-1]->time = players[consoleplayer].realtime;
|
||||
|
||||
if ((mainrecords[gamemap-1]->lap == 0) || (bestlap < mainrecords[gamemap-1]->lap))
|
||||
mainrecords[gamemap-1]->lap = bestlap;
|
||||
if ((mainrecords[gamemap-1]->lap == 0) || (players[consoleplayer].laptime[LAP_BEST] < mainrecords[gamemap-1]->lap))
|
||||
mainrecords[gamemap-1]->lap = players[consoleplayer].laptime[LAP_BEST];
|
||||
|
||||
// Save demo!
|
||||
bestdemo[255] = '\0';
|
||||
lastdemo[255] = '\0';
|
||||
G_SetDemoTime(players[consoleplayer].realtime, bestlap);
|
||||
G_SetDemoTime(players[consoleplayer].realtime, players[consoleplayer].laptime[LAP_BEST]);
|
||||
G_CheckDemoStatus();
|
||||
|
||||
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
|
||||
|
||||
Reference in new issue
Block a user