}
}
-void spawnfunc_path_corner() { }
+void set_platmovetype(entity e, string s)
+{
+ // sets platmovetype_start and platmovetype_end based on a string consisting of two values
+ if(s == "")
+ return;
+
+ float n;
+ n = tokenize_console(s);
+ e.platmovetype_start = stof(argv(0));
+ e.platmovetype_end = stof(argv(0));
+ if(n > 1)
+ e.platmovetype_end = stof(argv(1));
+}
+
+void spawnfunc_path_corner()
+{
+ // setup values for overriding train movement
+ // if a second value does not exist, both start and end speeds are the single value specified
+ set_platmovetype(self, self.platmovetype);
+}
void spawnfunc_func_plat()
{
if (self.sounds == 0)
entity targ;
vector org;
targ = find(world, targetname, self.target);
- org = normalize(targ.origin - (self.origin - self.mins));
+ org = normalize(targ.origin);
SUB_CalcAngleMove(org, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
self.train_wait_turning = TRUE;
return;
if (!self.wait)
self.wait = 0.1;
+ // override train movement type if necessary
+ if(targ.platmovetype_start || targ.platmovetype_end)
+ set_platmovetype(self, targ.platmovetype);
+ else
+ set_platmovetype(self, self.platmovetype);
+
if (targ.speed)
{
if (self.spawnflags & 1)
self.dmgtime = 0.25;
self.dmgtime2 = time;
+ set_platmovetype(self, self.platmovetype);
+
// TODO make a reset function for this one
}