Prevent sigsevs
This commit is contained in:
parent
479af14832
commit
4d4a6a29f1
1 changed files with 7 additions and 4 deletions
11
src/k_kart.c
11
src/k_kart.c
|
|
@ -8776,7 +8776,7 @@ void K_SetRespawnAtNextWaypoint(player_t * player)
|
|||
oopisepoint = K_GetClosestWaypointToMobj(player->mo);
|
||||
}
|
||||
|
||||
if (oopisepoint->numnextwaypoints > 0)
|
||||
if (oopisepoint && oopisepoint->numnextwaypoints > 0)
|
||||
{
|
||||
for (i = 0; i < oopisepoint->numnextwaypoints; i++)
|
||||
{
|
||||
|
|
@ -8820,10 +8820,14 @@ void K_SetRespawnAtNextWaypoint(player_t * player)
|
|||
safewaypoint = oopisepoint->nextwaypoints[i];
|
||||
break;
|
||||
}
|
||||
oopisepoint = safewaypoint;
|
||||
|
||||
if (safewaypoint)
|
||||
{
|
||||
oopisepoint = safewaypoint;
|
||||
}
|
||||
}
|
||||
|
||||
if (oopisepoint->numprevwaypoints > 0)
|
||||
if (oopisepoint && oopisepoint->numprevwaypoints > 0)
|
||||
{
|
||||
for (i = 0; i < oopisepoint->numprevwaypoints; i++)
|
||||
{
|
||||
|
|
@ -8856,7 +8860,6 @@ void K_SetRespawnAtNextWaypoint(player_t * player)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
CONS_Debug(DBG_GAMELOGIC, M_GetText("Tried to respawn at invalid waypoint! Setting respawn to closest waypoint\n"));
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue