remove checkpointtimes and k_playerahead

they are basically unused outside of timeattack and checkpointtimes isn't sent for netplay anyway
we can reimplement later with a more sensible solution for lap times in time attack
This commit is contained in:
Sryder 2017-03-06 21:02:36 +00:00
parent 1970f4f280
commit f00f74d69b
6 changed files with 0 additions and 86 deletions

View file

@ -235,7 +235,6 @@ typedef enum
{
// Basic gameplay things
k_position, // Used for Kart positions, mostly for deterministic stuff
k_playerahead, // Is someone ahead of me or not?
k_oldposition, // Used for taunting when you pass someone
k_positiondelay, // Prevents player from taunting continuously if two people were neck-and-neck
k_prevcheck, // Previous checkpoint distance; for p_user.c (was "pw_pcd")
@ -453,7 +452,6 @@ typedef struct player_s
INT16 totalring; // Total number of rings obtained for Race Mode
tic_t realtime; // integer replacement for leveltime
UINT8 laps; // Number of laps (optional)
tic_t checkpointtimes[256]; // Individual checkpoint times // SRB2kart
////////////////////
// CTF Mode Stuff //

View file

@ -2185,9 +2185,6 @@ void G_PlayerReborn(INT32 player)
SINT8 pity;
// SRB2kart
INT32 x;
tic_t checkpointtimes[256];
INT32 playerahead;
INT32 starpostwp;
INT32 lakitu;
INT32 offroad;
@ -2243,8 +2240,6 @@ void G_PlayerReborn(INT32 player)
pity = players[player].pity;
// SRB2kart
for (x = 0; x < (256); x++) checkpointtimes[x] = players[player].checkpointtimes[x];
playerahead = players[player].kartstuff[k_playerahead];
starpostwp = players[player].kartstuff[k_starpostwp];
lakitu = players[player].kartstuff[k_lakitu];
offroad = players[player].kartstuff[k_offroad];
@ -2301,8 +2296,6 @@ void G_PlayerReborn(INT32 player)
p->pity = pity;
// SRB2kart
for (x = 0; x < 256; x++) p->checkpointtimes[x] = checkpointtimes[x];
p->kartstuff[k_playerahead] = playerahead;
p->kartstuff[k_starpostwp] = starpostwp;
p->kartstuff[k_lakitu] = lakitu;
p->kartstuff[k_offroad] = offroad;

View file

@ -1186,8 +1186,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// Save the player's time and position.
player->starposttime = player->realtime; //this makes race mode's timers work correctly whilst not affecting sp -x
if (((special->health - 1) + (numstarposts+1)*player->laps) < 256) // SIGSEGV prevention
player->checkpointtimes[(special->health - 1) + (numstarposts+1)*player->laps] = player->realtime;
//player->starposttime = leveltime;
player->starpostx = toucher->x>>FRACBITS;
player->starposty = toucher->y>>FRACBITS;
@ -1196,10 +1194,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
player->starpostnum = special->health;
P_ClearStarPost(special->health);
// SRB2kart
if (gametype == GT_RACE)
player->kartstuff[k_playerahead] = P_CheckPlayerAhead(player, (special->health - 1) + (numstarposts+1)*player->laps);
// Find all starposts in the level with this value.
{
thinker_t *th;
@ -1498,56 +1492,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_KillMobj(special, NULL, toucher);
}
// SRB2kart
INT32 P_CheckPlayerAhead(player_t *player, INT32 tocheck)
{
INT32 i, retvalue = 0, me = -1;
tic_t besttime = 0xffffffff;
if (tocheck >= 256)
return 0; //Don't SIGSEGV.
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (player == &players[i]) //you're me!
{
me = i;
continue;
}
if (!players[i].checkpointtimes[tocheck])
continue;
if (players[i].checkpointtimes[tocheck] >= besttime)
continue;
besttime = players[i].checkpointtimes[tocheck];
retvalue = i+1;
}
if (!retvalue)
return 0;
if (besttime >= player->realtime) // > sign is practically paranoia
{
if (!players[retvalue-1].kartstuff[k_playerahead] && me != -1
&& players[retvalue-1].laps == player->laps
&& players[retvalue-1].starpostnum == player->starpostnum)
players[retvalue-1].kartstuff[k_playerahead] = 65536;
return 65536; //we're tied!
}
//checkplayerahead does this too!
if (!players[retvalue-1].kartstuff[k_playerahead] && me != -1
&& players[retvalue-1].laps == player->laps
&& players[retvalue-1].starpostnum == player->starpostnum)
players[retvalue-1].kartstuff[k_playerahead] = 257 + me;
return retvalue;
}
//
/** Prints death messages relating to a dying or hit player.
*

View file

@ -388,10 +388,6 @@ void P_CheckPointLimit(void);
void P_CheckSurvivors(void);
boolean P_CheckRacers(void);
// SRB2kart
INT32 P_CheckPlayerAhead(player_t *player, INT32 tocheck);
//
void P_ClearStarPost(INT32 postnum);
void P_ResetStarposts(void);

View file

@ -4085,9 +4085,6 @@ DoneSection2:
player->starpostx = player->starposty = player->starpostz = 0;
//except the time!
player->starposttime = player->realtime;
if (((numstarposts+1)*player->laps - 1) < 256) //SIGSEGV prevention
player->checkpointtimes[(numstarposts+1)*player->laps - 1] = player->realtime;
player->kartstuff[k_playerahead] = P_CheckPlayerAhead(player, (numstarposts+1)*player->laps - 1);
if (P_IsLocalPlayer(player))
{

View file

@ -240,20 +240,6 @@ void Y_IntermissionDrawer(void)
//if (gottimebonus && endtic != -1)
// V_DrawCenteredString(BASEVIDWIDTH/2, 172, V_YELLOWMAP, "TIME BONUS UNLOCKED!");
V_DrawString(70, 106, V_YELLOWMAP, "LAP 1");
V_DrawString(70, 116, V_YELLOWMAP, "LAP 2");
V_DrawString(70, 126, V_YELLOWMAP, "LAP 3");
{
INT32 laptime;
laptime = stplyr->checkpointtimes[(numstarposts+1) - 1];
V_DrawRightAlignedString(250, 106, 0, va("%d:%02d.%02d", laptime/(60*TICRATE), laptime/TICRATE % 60, (int)((laptime%TICRATE) * (100.00f/TICRATE))));
laptime = stplyr->checkpointtimes[((numstarposts+1)*2) - 1] - stplyr->checkpointtimes[(numstarposts+1) - 1];
V_DrawRightAlignedString(250, 116, 0, va("%d:%02d.%02d", laptime/(60*TICRATE), laptime/TICRATE % 60, (int)((laptime%TICRATE) * (100.00f/TICRATE))));
laptime = stplyr->realtime - stplyr->checkpointtimes[((numstarposts+1)*2) - 1];
V_DrawRightAlignedString(250, 126, 0, va("%d:%02d.%02d", laptime/(60*TICRATE), laptime/TICRATE % 60, (int)((laptime%TICRATE) * (100.00f/TICRATE))));
}
}
else if (intertype == int_race)
{