From 39444571f4e93a6e3d35718c2c9a3e3b1dff4cb2 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Mon, 21 May 2012 22:08:24 +0300 Subject: [PATCH] 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 --- qcsrc/server/t_plats.qc | 7 +++++++ 1 file changed, 7 insertions(+) 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"); -- 2.39.2