From: terencehill Date: Sat, 20 May 2017 08:34:30 +0000 (+0200) Subject: g_waypointeditor_unreachable: avoid a qc crash when there's no waypoint nearby X-Git-Tag: xonotic-v0.8.5~2378^2~155 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=736f0b6d29fa0d1f820bf9618814d7a83d7394e0;p=xonotic%2Fxonotic-data.pk3dir.git g_waypointeditor_unreachable: avoid a qc crash when there's no waypoint nearby --- diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc index 7a5728ac8..f058217dc 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -24,7 +24,14 @@ void waypoint_unreachable(entity pl) it.colormod = '0.5 0.5 0.5'; it.effects &= ~(EF_NODEPTHTEST | EF_RED | EF_BLUE); }); + entity e2 = navigation_findnearestwaypoint(pl, false); + if(!e2) + { + LOG_INFOF("Can't find any waypoint nearby\n"); + return; + } + navigation_markroutes(pl, e2); int j = 0;