From: Mircea Kitsune Date: Mon, 21 May 2012 19:44:10 +0000 (+0300) Subject: Actually, don't treat a path_corner without a control point as an error. If you WANT... X-Git-Tag: xonotic-v0.8.0~295^2~49 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e56d204724dfc44193502ac47e7710b08eb5c2ba;p=xonotic%2Fxonotic-data.pk3dir.git Actually, don't treat a path_corner without a control point as an error. If you WANT a straight path, you can simply not include a control point and save an extra entity --- diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index 3e506ad2b..d05cb5da7 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -285,16 +285,10 @@ void train_next() self.target = targ.target; if (self.spawnflags & 1) { - entity prev; - prev = find(world, target, targ.targetname); // get the previous corner first - cp = find(world, targetname, prev.target2); // now get its second target (the control point) - if(cp.targetname == "") // none found - { - // when using bezier curves, you must have a control point for each corner in the path - if(autocvar_developer) - dprint(strcat("Warning: func_train using beizer curves reached the path_corner '", prev.targetname, "' which does not have a control point. Please add a target2 for each path_corner used by this train!\n")); - cp_org = targ.origin - self.mins; // assume a straight line to the destination as fallback - } + cp = find(world, target, targ.targetname); // get the previous corner first + cp = find(world, targetname, cp.target2); // now get its second target (the control point) + if(cp.targetname == "") + cp_org = targ.origin - self.mins; // no control point found, assume a straight line to the destination else cp_org = cp.origin - self.mins; }