mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add currentwaypoint
This commit is contained in:
parent
90e3d01395
commit
b55c67c29d
4 changed files with 14 additions and 2 deletions
|
|
@ -413,6 +413,7 @@ typedef struct player_s
|
|||
UINT8 oldposition; // Used for taunting when you pass someone
|
||||
UINT8 positiondelay; // Used for position number, so it can grow when passing
|
||||
UINT32 distancetofinish;
|
||||
waypoint_t *currentwaypoint;
|
||||
waypoint_t *nextwaypoint;
|
||||
respawnvars_t respawn; // Respawn info
|
||||
tic_t airtime; // Keep track of how long you've been in the air
|
||||
|
|
|
|||
|
|
@ -4634,7 +4634,8 @@ static void K_DrawWaypointDebugger(void)
|
|||
if (stplyr != &players[displayplayers[0]]) // only for p1
|
||||
return;
|
||||
|
||||
V_DrawString(8, 166, 0, va("'Best' Waypoint ID: %d", K_GetWaypointID(stplyr->nextwaypoint)));
|
||||
V_DrawString(8, 156, 0, va("Current Waypoint ID: %d", K_GetWaypointID(stplyr->currentwaypoint)));
|
||||
V_DrawString(8, 166, 0, va("Next Waypoint ID: %d", K_GetWaypointID(stplyr->nextwaypoint)));
|
||||
V_DrawString(8, 176, 0, va("Finishline Distance: %d", stplyr->distancetofinish));
|
||||
|
||||
if (numstarposts > 0)
|
||||
|
|
|
|||
|
|
@ -8855,7 +8855,8 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
waypoint_t *waypoint = K_GetBestWaypointForMobj(player->mo);
|
||||
boolean updaterespawn = false;
|
||||
|
||||
bestwaypoint = waypoint;
|
||||
// Our current waypoint.
|
||||
player->currentwaypoint = bestwaypoint = waypoint;
|
||||
|
||||
// check the waypoint's location in relation to the player
|
||||
// If it's generally in front, it's fine, otherwise, use the best next/previous waypoint.
|
||||
|
|
|
|||
|
|
@ -4422,6 +4422,15 @@ static void P_RelinkPointers(void)
|
|||
if (!P_SetTarget(&mobj->player->follower, P_FindNewPosition(temp)))
|
||||
CONS_Debug(DBG_GAMELOGIC, "follower not found on %d\n", mobj->type);
|
||||
}
|
||||
if (mobj->player->currentwaypoint)
|
||||
{
|
||||
temp = (UINT32)(size_t)mobj->player->currentwaypoint;
|
||||
mobj->player->currentwaypoint = K_GetWaypointFromIndex(temp);
|
||||
if (mobj->player->currentwaypoint == NULL)
|
||||
{
|
||||
CONS_Debug(DBG_GAMELOGIC, "currentwaypoint not found on %d\n", mobj->type);
|
||||
}
|
||||
}
|
||||
if (mobj->player->nextwaypoint)
|
||||
{
|
||||
temp = (UINT32)(size_t)mobj->player->nextwaypoint;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue