mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Reset player lap when they reset to track
This commit is contained in:
parent
5235408b0e
commit
f0d0a0f07b
5 changed files with 17 additions and 1 deletions
|
|
@ -852,6 +852,8 @@ struct player_t
|
||||||
UINT8 sliptideZipDelay; // How long since the last sliptide? Only boost once you've been straightened out for a bit.
|
UINT8 sliptideZipDelay; // How long since the last sliptide? Only boost once you've been straightened out for a bit.
|
||||||
UINT16 sliptideZipBoost; // The actual boost granted from sliptideZip.
|
UINT16 sliptideZipBoost; // The actual boost granted from sliptideZip.
|
||||||
|
|
||||||
|
UINT8 lastsafelap;
|
||||||
|
|
||||||
mobj_t *stumbleIndicator;
|
mobj_t *stumbleIndicator;
|
||||||
mobj_t *sliptideZipIndicator;
|
mobj_t *sliptideZipIndicator;
|
||||||
mobj_t *whip;
|
mobj_t *whip;
|
||||||
|
|
|
||||||
|
|
@ -8968,6 +8968,7 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
||||||
(K_GetWaypointIsEnabled(bestwaypoint) == true))
|
(K_GetWaypointIsEnabled(bestwaypoint) == true))
|
||||||
{
|
{
|
||||||
player->respawn.wp = bestwaypoint;
|
player->respawn.wp = bestwaypoint;
|
||||||
|
player->lastsafelap = player->laps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,12 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
|
||||||
P_SetThingPosition(player->mo);
|
P_SetThingPosition(player->mo);
|
||||||
|
|
||||||
// We are no longer traveling from death location to 1st waypoint, so use standard timings
|
// We are no longer traveling from death location to 1st waypoint, so use standard timings
|
||||||
player->respawn.fast = false;
|
// (and reset their lap so they can't cross the finish the wrong way!)
|
||||||
|
if (player->respawn.fast)
|
||||||
|
{
|
||||||
|
player->respawn.fast = false;
|
||||||
|
player->laps = player->lastsafelap;
|
||||||
|
}
|
||||||
|
|
||||||
// At the first valid waypoint, permit extra player control options.
|
// At the first valid waypoint, permit extra player control options.
|
||||||
player->respawn.init = false;
|
player->respawn.init = false;
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,8 @@ static int player_get(lua_State *L)
|
||||||
lua_pushinteger(L, plr->sliptideZipDelay);
|
lua_pushinteger(L, plr->sliptideZipDelay);
|
||||||
else if (fastcmp(field,"sliptideZipBoost"))
|
else if (fastcmp(field,"sliptideZipBoost"))
|
||||||
lua_pushinteger(L, plr->sliptideZipBoost);
|
lua_pushinteger(L, plr->sliptideZipBoost);
|
||||||
|
else if (fastcmp(field,"lastsafelap"))
|
||||||
|
lua_pushinteger(L, plr->lastsafelap);
|
||||||
else if (fastcmp(field,"instaWhipCharge"))
|
else if (fastcmp(field,"instaWhipCharge"))
|
||||||
lua_pushinteger(L, plr->instaWhipCharge);
|
lua_pushinteger(L, plr->instaWhipCharge);
|
||||||
else if (fastcmp(field,"instaWhipCooldown"))
|
else if (fastcmp(field,"instaWhipCooldown"))
|
||||||
|
|
@ -809,6 +811,8 @@ static int player_set(lua_State *L)
|
||||||
plr->sliptideZipDelay = luaL_checkinteger(L, 3);
|
plr->sliptideZipDelay = luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"sliptideZipBoost"))
|
else if (fastcmp(field,"sliptideZipBoost"))
|
||||||
plr->sliptideZipBoost = luaL_checkinteger(L, 3);
|
plr->sliptideZipBoost = luaL_checkinteger(L, 3);
|
||||||
|
else if (fastcmp(field,"lastsafelap"))
|
||||||
|
plr->lastsafelap = luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"instaWhipCharge"))
|
else if (fastcmp(field,"instaWhipCharge"))
|
||||||
plr->instaWhipCharge = luaL_checkinteger(L, 3);
|
plr->instaWhipCharge = luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"instaWhipCooldown"))
|
else if (fastcmp(field,"instaWhipCooldown"))
|
||||||
|
|
|
||||||
|
|
@ -539,6 +539,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
||||||
WRITEUINT8(save->p, players[i].sliptideZipDelay);
|
WRITEUINT8(save->p, players[i].sliptideZipDelay);
|
||||||
WRITEUINT16(save->p, players[i].sliptideZipBoost);
|
WRITEUINT16(save->p, players[i].sliptideZipBoost);
|
||||||
|
|
||||||
|
WRITEUINT8(save->p, players[i].lastsafelap);
|
||||||
|
|
||||||
WRITEMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
WRITEMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
||||||
|
|
||||||
WRITEUINT8(save->p, players[i].instaWhipCharge);
|
WRITEUINT8(save->p, players[i].instaWhipCharge);
|
||||||
|
|
@ -1052,6 +1054,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
||||||
players[i].sliptideZipDelay = READUINT8(save->p);
|
players[i].sliptideZipDelay = READUINT8(save->p);
|
||||||
players[i].sliptideZipBoost = READUINT16(save->p);
|
players[i].sliptideZipBoost = READUINT16(save->p);
|
||||||
|
|
||||||
|
players[i].lastsafelap = READUINT8(save->p);
|
||||||
|
|
||||||
READMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
READMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
||||||
|
|
||||||
players[i].instaWhipCharge = READUINT8(save->p);
|
players[i].instaWhipCharge = READUINT8(save->p);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue