]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
g_waypointeditor_unreachable: avoid a qc crash when there's no waypoint nearby
authorterencehill <piuntn@gmail.com>
Sat, 20 May 2017 08:34:30 +0000 (10:34 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 20 May 2017 08:34:30 +0000 (10:34 +0200)
qcsrc/server/bot/default/waypoints.qc

index 7a5728ac843118026e3587bd04d8bba7c14573ab..f058217dc16a236aa25e39435fbff0b8f7083fad 100644 (file)
@@ -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;