mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'speedy-lightsnake' into 'master'
Lightsnake back to track in consistent time See merge request KartKrew/Kart!1522
This commit is contained in:
commit
1caea27f82
3 changed files with 20 additions and 0 deletions
|
|
@ -342,6 +342,8 @@ struct respawnvars_t
|
|||
boolean manual; // Respawn coords were manually set, please respawn exactly there
|
||||
boolean fromRingShooter; // Respawn was from Ring Shooter, don't allow E-Brake drop
|
||||
boolean init;
|
||||
boolean fast; // Deaths after long airtime can leave you far away from your first waypoint, speed over there!
|
||||
fixed_t returnspeed; // Used for consistent timing for deathpoint-to-first-waypoint travel.
|
||||
};
|
||||
|
||||
typedef enum
|
||||
|
|
|
|||
|
|
@ -287,6 +287,8 @@ void K_DoIngameRespawn(player_t *player)
|
|||
player->respawn.timer = RESPAWN_TIME;
|
||||
player->respawn.state = RESPAWNST_MOVE;
|
||||
player->respawn.init = true;
|
||||
player->respawn.fast = true;
|
||||
player->respawn.returnspeed = 0;
|
||||
|
||||
player->respawn.airtimer = player->airtime;
|
||||
player->respawn.truedeath = !!(player->pflags & PF_FAULT);
|
||||
|
|
@ -338,6 +340,7 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
|
|||
{
|
||||
const int airCompensation = 128;
|
||||
fixed_t realstepamt = (64 * mapobjectscale);
|
||||
UINT32 returntime = TICRATE;
|
||||
fixed_t stepamt;
|
||||
|
||||
vector3_t dest, step, laser;
|
||||
|
|
@ -379,6 +382,14 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
|
|||
player->mo->z - dest.z
|
||||
);
|
||||
|
||||
// Traveling from death location to first waypoint? Set speed to get there in a fixed time.
|
||||
if (player->respawn.fast)
|
||||
{
|
||||
if (player->respawn.returnspeed == 0)
|
||||
player->respawn.returnspeed = dist / returntime;
|
||||
stepamt = max(stepamt, player->respawn.returnspeed);
|
||||
}
|
||||
|
||||
if (dist <= stepamt)
|
||||
{
|
||||
// Reduce by the amount we needed to get to this waypoint
|
||||
|
|
@ -391,6 +402,9 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
|
|||
player->mo->z = dest.z;
|
||||
P_SetThingPosition(player->mo);
|
||||
|
||||
// We are no longer traveling from death location to 1st waypoint, so use standard timings
|
||||
player->respawn.fast = false;
|
||||
|
||||
// At the first valid waypoint, permit extra player control options.
|
||||
player->respawn.init = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -567,6 +567,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT32(save->p, players[i].respawn.dropdash);
|
||||
WRITEUINT8(save->p, players[i].respawn.truedeath);
|
||||
WRITEUINT8(save->p, players[i].respawn.manual);
|
||||
WRITEUINT8(save->p, players[i].respawn.fast);
|
||||
WRITEUINT32(save->p, players[i].respawn.returnspeed);
|
||||
|
||||
// botvars_t
|
||||
WRITEUINT8(save->p, players[i].bot);
|
||||
|
|
@ -1043,6 +1045,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].respawn.dropdash = READUINT32(save->p);
|
||||
players[i].respawn.truedeath = READUINT8(save->p);
|
||||
players[i].respawn.manual = READUINT8(save->p);
|
||||
players[i].respawn.fast = READUINT8(save->p);
|
||||
players[i].respawn.returnspeed = READUINT32(save->p);
|
||||
|
||||
// botvars_t
|
||||
players[i].bot = READUINT8(save->p);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue