Use RingRacers line fudge for setting starpost values with new waypoitns
This commit is contained in:
parent
ff0dcd94a2
commit
03478b6458
1 changed files with 20 additions and 0 deletions
20
src/k_kart.c
20
src/k_kart.c
|
|
@ -7777,6 +7777,21 @@ static UINT32 u32_delta(UINT32 x, UINT32 y)
|
|||
return x > y ? x - y : y - x;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
* static void K_FudgeRespawn(player_t *player, const waypoint_t *const waypoint)
|
||||
*
|
||||
* Fudges respawn coordinates to slightly before the waypoint if it would
|
||||
* be exactly on a line. See K_GetWaypointIsOnLine.
|
||||
- *-------------------------------------------------*/
|
||||
static void K_FudgeRespawn(player_t *player, const waypoint_t *const waypoint)
|
||||
{
|
||||
const angle_t from = R_PointToAngle2(waypoint->mobj->x, waypoint->mobj->y,
|
||||
player->mo->x, player->mo->y) >> ANGLETOFINESHIFT;
|
||||
|
||||
player->starpostx += FixedMul(16, FINECOSINE(from));
|
||||
player->starposty += FixedMul(16, FINESINE(from));
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
static void K_UpdatePlayerWaypoints(player_t *const player)
|
||||
|
||||
|
|
@ -7833,6 +7848,11 @@ static void K_UpdatePlayerWaypoints(player_t *const player)
|
|||
// Then do x and y
|
||||
player->starpostx = player->mo->x >> FRACBITS;
|
||||
player->starposty = player->mo->y >> FRACBITS;
|
||||
|
||||
if (player->nextwaypoint->onaline)
|
||||
{
|
||||
K_FudgeRespawn(player, player->nextwaypoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue