Add safety for next respawn
This commit is contained in:
parent
c3351ce47c
commit
9d244dd89d
1 changed files with 11 additions and 2 deletions
13
src/k_kart.c
13
src/k_kart.c
|
|
@ -9085,9 +9085,18 @@ void K_SetRespawnAtNextWaypoint(player_t * player)
|
|||
if ((player != NULL) && (player->mo != NULL) && (P_MobjWasRemoved(player->mo) == false))
|
||||
{
|
||||
// Safety :P
|
||||
if (!player->currentwaypoint || !player->nextwaypoint)
|
||||
if (!player->currentwaypoint || !player->nextwaypoint || !K_SafeRespawnPosition(player->nextwaypoint->mobj))
|
||||
{
|
||||
waypoint_t *oopisepoint = K_GetBestWaypointForMobj(player->mo, NULL);
|
||||
waypoint_t *oopisepoint = NULL;
|
||||
|
||||
if (player->nextwaypoint)
|
||||
{
|
||||
oopisepoint = player->nextwaypoint;
|
||||
}
|
||||
else
|
||||
{
|
||||
oopisepoint = K_GetBestWaypointForMobj(player->mo, NULL);
|
||||
}
|
||||
|
||||
if (!oopisepoint || !oopisepoint->mobj)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue