]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Execute fallback code if a path_corner for a beizer curves train doesn't have a contr...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 21 May 2012 19:08:24 +0000 (22:08 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 21 May 2012 19:08:24 +0000 (22:08 +0300)
qcsrc/server/t_plats.qc

index 0c498640de27933efe80227bc8155cc8ff1d1d22..70f0a4776bc69b9cdd45e635c26a1e881b12ca2e 100644 (file)
@@ -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");