From e2a9aeb34c8f77ab19c1859656a1ca0cc81a9d66 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 27 Nov 2018 14:28:11 -0500 Subject: [PATCH] Require 3/5ths of checkpoints instead of 1/2 This broke MKSC in a minor way if you skip a specific item set and then take the big cut... I'll let it go anyway since its an improvement everywhere else. --- src/d_clisrv.c | 2 -- src/d_clisrv.h | 1 - src/d_player.h | 1 - src/g_game.c | 6 ------ src/k_kart.c | 4 ++-- src/lua_playerlib.c | 4 ---- src/p_inter.c | 4 +--- src/p_saveg.c | 2 -- src/p_spec.c | 5 ++--- 9 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 8c28262d..7b8c0127 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -619,7 +619,6 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i) rsp->starposty = SHORT(players[i].starposty); rsp->starpostz = SHORT(players[i].starpostz); rsp->starpostnum = LONG(players[i].starpostnum); - rsp->starpostcount = LONG(players[i].starpostcount); rsp->starposttime = (tic_t)LONG(players[i].starposttime); rsp->starpostangle = (angle_t)LONG(players[i].starpostangle); @@ -755,7 +754,6 @@ static void resynch_read_player(resynch_pak *rsp) players[i].starposty = SHORT(rsp->starposty); players[i].starpostz = SHORT(rsp->starpostz); players[i].starpostnum = LONG(rsp->starpostnum); - players[i].starpostcount = LONG(rsp->starpostcount); players[i].starposttime = (tic_t)LONG(rsp->starposttime); players[i].starpostangle = (angle_t)LONG(rsp->starpostangle); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index e767a91e..d4090b26 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -251,7 +251,6 @@ typedef struct INT16 starposty; INT16 starpostz; INT32 starpostnum; - INT32 starpostcount; tic_t starposttime; angle_t starpostangle; diff --git a/src/d_player.h b/src/d_player.h index c8743717..2ff781e1 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -515,7 +515,6 @@ typedef struct player_s INT16 starposty; INT16 starpostz; INT32 starpostnum; // The number of the last starpost you hit - INT32 starpostcount; // SRB2kart: how many did you hit? tic_t starposttime; // Your time when you hit the starpost angle_t starpostangle; // Angle that the starpost is facing - you respawn facing this way diff --git a/src/g_game.c b/src/g_game.c index 656392a3..80fc3950 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2266,7 +2266,6 @@ static inline void G_PlayerFinishLevel(INT32 player) p->starposty = 0; p->starpostz = 0; p->starpostnum = 0; - p->starpostcount = 0; // SRB2kart: Increment the "matches played" counter. if (player == consoleplayer) @@ -2318,7 +2317,6 @@ void G_PlayerReborn(INT32 player) INT16 starposty; INT16 starpostz; INT32 starpostnum; - INT32 starpostcount; INT32 starpostangle; fixed_t jumpfactor; INT32 exiting; @@ -2382,7 +2380,6 @@ void G_PlayerReborn(INT32 player) starposty = players[player].starposty; starpostz = players[player].starpostz; starpostnum = players[player].starpostnum; - starpostcount = players[player].starpostcount; starpostangle = players[player].starpostangle; jumpfactor = players[player].jumpfactor; thokitem = players[player].thokitem; @@ -2474,7 +2471,6 @@ void G_PlayerReborn(INT32 player) p->starposty = starposty; p->starpostz = starpostz; p->starpostnum = starpostnum; - p->starpostcount = starpostcount; p->starpostangle = starpostangle; p->jumpfactor = jumpfactor; p->exiting = exiting; @@ -2938,7 +2934,6 @@ void G_DoReborn(INT32 playernum) player->starposty = 0; player->starpostz = 0; player->starpostnum = 0; - player->starpostcount = 0; } if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD)) { @@ -4326,7 +4321,6 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool players[i].playerstate = PST_REBORN; players[i].starpostangle = players[i].starpostnum = players[i].starposttime = 0; players[i].starpostx = players[i].starposty = players[i].starpostz = 0; - players[i].starpostcount = 0; // srb2kart #if 0 if (netgame || multiplayer) diff --git a/src/k_kart.c b/src/k_kart.c index b7a17cee..eb7d7493 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7982,10 +7982,10 @@ static void K_drawCheckpointDebugger(void) if (stplyr != &players[displayplayer]) // only for p1 return; - if ((numstarposts/2 + stplyr->starpostnum) >= numstarposts) + if (stplyr->starpostnum >= (numstarposts - (2*numstarposts)/5)) V_DrawString(8, 184, 0, va("Checkpoint: %d / %d (Can finish)", stplyr->starpostnum, numstarposts)); else - V_DrawString(8, 184, 0, va("Checkpoint: %d / %d (Skip: %d)", stplyr->starpostnum, numstarposts, (numstarposts/2 + stplyr->starpostnum))); + V_DrawString(8, 184, 0, va("Checkpoint: %d / %d (Skip: %d)", stplyr->starpostnum, numstarposts, ((2*numstarposts)/5 + stplyr->starpostnum))); V_DrawString(8, 192, 0, va("Waypoint dist: Prev %d, Next %d", stplyr->kartstuff[k_prevcheck], stplyr->kartstuff[k_nextcheck])); } diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 1eed10b0..53f09851 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -246,8 +246,6 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->starpostz); else if (fastcmp(field,"starpostnum")) lua_pushinteger(L, plr->starpostnum); - else if (fastcmp(field,"starpostcount")) - lua_pushinteger(L, plr->starpostcount); else if (fastcmp(field,"starposttime")) lua_pushinteger(L, plr->starposttime); else if (fastcmp(field,"starpostangle")) @@ -519,8 +517,6 @@ static int player_set(lua_State *L) plr->starpostz = (INT16)luaL_checkinteger(L, 3); else if (fastcmp(field,"starpostnum")) plr->starpostnum = (INT32)luaL_checkinteger(L, 3); - else if (fastcmp(field,"starpostcount")) - plr->starpostcount = (INT32)luaL_checkinteger(L, 3); else if (fastcmp(field,"starposttime")) plr->starposttime = (tic_t)luaL_checkinteger(L, 3); else if (fastcmp(field,"starpostangle")) diff --git a/src/p_inter.c b/src/p_inter.c index cabf3aa2..28ce0d96 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1425,8 +1425,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } // // SRB2kart: make sure the player will have enough checkpoints to touch - if (circuitmap - && special->health >= (numstarposts/2 + player->starpostnum)) + if (circuitmap && special->health >= ((2*numstarposts)/5 + player->starpostnum)) { // blatant reuse of a variable that's normally unused in circuit if (!player->tossdelay) @@ -1453,7 +1452,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) player->starpostz = special->z>>FRACBITS; player->starpostangle = special->angle; player->starpostnum = special->health; - player->starpostcount++; //S_StartSound(toucher, special->info->painsound); return; diff --git a/src/p_saveg.c b/src/p_saveg.c index e702d460..345d97c0 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -198,7 +198,6 @@ static void P_NetArchivePlayers(void) WRITEINT16(save_p, players[i].starposty); WRITEINT16(save_p, players[i].starpostz); WRITEINT32(save_p, players[i].starpostnum); - WRITEINT32(save_p, players[i].starpostcount); WRITEANGLE(save_p, players[i].starpostangle); WRITEANGLE(save_p, players[i].angle_pos); @@ -382,7 +381,6 @@ static void P_NetUnArchivePlayers(void) players[i].starposty = READINT16(save_p); players[i].starpostz = READINT16(save_p); players[i].starpostnum = READINT32(save_p); - players[i].starpostcount = READINT32(save_p); players[i].starpostangle = READANGLE(save_p); players[i].angle_pos = READANGLE(save_p); diff --git a/src/p_spec.c b/src/p_spec.c index 6ac325cd..935c7d90 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4190,12 +4190,12 @@ DoneSection2: case 10: // Finish Line // SRB2kart - 150117 - if (G_RaceGametype() && (player->starpostcount >= numstarposts/2 || player->exiting)) + if (G_RaceGametype() && (player->starpostnum >= (numstarposts - (2*numstarposts)/5) || player->exiting)) player->kartstuff[k_starpostwp] = player->kartstuff[k_waypoint] = 0; // if (G_RaceGametype() && !player->exiting) { - if (player->starpostcount >= numstarposts/2) // srb2kart: must have touched *enough* starposts (was originally "(player->starpostnum == numstarposts)") + if (player->starpostnum >= (numstarposts - (2*numstarposts)/5)) // srb2kart: must have touched *enough* starposts (was originally "(player->starpostnum == numstarposts)") { UINT8 nump = 0; @@ -4244,7 +4244,6 @@ DoneSection2: // SRB2kart 200117 player->starpostangle = player->starpostnum = 0; player->starpostx = player->starposty = player->starpostz = 0; - player->starpostcount = 0; //except the time! player->starposttime = player->realtime;