From: Mircea Kitsune Date: Mon, 21 May 2012 19:08:24 +0000 (+0300) Subject: Execute fallback code if a path_corner for a beizer curves train doesn't have a contr... X-Git-Tag: xonotic-v0.8.0~295^2~56 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=39444571f4e93a6e3d35718c2c9a3e3b1dff4cb2 Execute fallback code if a path_corner for a beizer curves train doesn't have a control point as target2. This includes a warning and assuming a straight line for origin (otherwise the train would go to origin 0 0 0 and back). For some reason this still doesn't work well --- diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index 0c498640de..70f0a4776b 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -285,6 +285,13 @@ void train_next() { cp = find(world, target, targ.targetname); // get the previous corner first cp = find(world, targetname, cp.target2); // now get its second target + if(!cp) + { + // if using bezier curves, you must have a control point for each corner in the train's path + if(autocvar_developer) + dprint("Warning: func_train using beizer curves reached a path_corner without a control point. Please add a target2 for each path_corner used by this train!"); + cp = targ; // assume a straight line to the destination as fallback + } } if (!self.target) objerror("train_next: no next target");