Merge branch 'sectionspawn' into 'master'
Respawn on intermediate finish line + cap numlaps cvar in sectionraces See merge request KartKrew/Kart!113
This commit is contained in:
commit
8cfa05471f
|
@ -4231,8 +4231,16 @@ static void PointLimit_OnChange(void)
|
||||||
|
|
||||||
static void NumLaps_OnChange(void)
|
static void NumLaps_OnChange(void)
|
||||||
{
|
{
|
||||||
|
if (!G_RaceGametype() || (modeattacking || demoplayback))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (server && Playing()
|
||||||
|
&& (netgame || multiplayer)
|
||||||
|
&& (mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE)
|
||||||
|
&& (cv_numlaps.value > mapheaderinfo[gamemap - 1]->numlaps))
|
||||||
|
CV_StealthSetValue(&cv_numlaps, mapheaderinfo[gamemap - 1]->numlaps);
|
||||||
|
|
||||||
// Just don't be verbose
|
// Just don't be verbose
|
||||||
if (G_RaceGametype() && !(modeattacking || demoplayback))
|
|
||||||
CONS_Printf(M_GetText("Number of laps set to %d\n"), cv_numlaps.value);
|
CONS_Printf(M_GetText("Number of laps set to %d\n"), cv_numlaps.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2997,7 +2997,7 @@ void G_DoReborn(INT32 playernum)
|
||||||
// respawn at the start
|
// respawn at the start
|
||||||
mobj_t *oldmo = NULL;
|
mobj_t *oldmo = NULL;
|
||||||
|
|
||||||
if (player->starpostnum) // SRB2kart
|
if (player->starpostnum || ((mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) && player->laps)) // SRB2kart
|
||||||
starpost = true;
|
starpost = true;
|
||||||
|
|
||||||
// first dissasociate the corpse
|
// first dissasociate the corpse
|
||||||
|
|
22
src/p_spec.c
22
src/p_spec.c
|
@ -4240,12 +4240,24 @@ DoneSection2:
|
||||||
curlap = 0;
|
curlap = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset starposts (checkpoints) info
|
|
||||||
// SRB2kart 200117
|
|
||||||
player->starpostangle = player->starpostnum = 0;
|
|
||||||
player->starpostx = player->starposty = player->starpostz = 0;
|
|
||||||
//except the time!
|
|
||||||
player->starposttime = player->realtime;
|
player->starposttime = player->realtime;
|
||||||
|
player->starpostnum = 0;
|
||||||
|
|
||||||
|
if (mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE)
|
||||||
|
{
|
||||||
|
// SRB2Kart 281118
|
||||||
|
// Save the player's time and position.
|
||||||
|
player->starpostx = player->mo->x>>FRACBITS;
|
||||||
|
player->starposty = player->mo->y>>FRACBITS;
|
||||||
|
player->starpostz = player->mo->floorz>>FRACBITS;
|
||||||
|
player->starpostangle = player->mo->angle; //R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); torn; a momentum-based guess is less likely to be wrong in general, but when it IS wrong, it fucks you over entirely...
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// SRB2kart 200117
|
||||||
|
// Reset starposts (checkpoints) info
|
||||||
|
player->starpostangle = player->starpostx = player->starposty = player->starpostz = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (P_IsLocalPlayer(player))
|
if (P_IsLocalPlayer(player))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue