self = oldself;
self.enemy = world;
- // if using bezier curves and turning is enabled, the train will turn toward the next point while waiting
- if(!self.train_wait_turning)
- if(self.spawnflags & 1 && self.bezier_turn && self.wait >= 0)
+ // if turning is enabled, the train will turn toward the next point while waiting
+ if(self.wait >= 0 && self.bezier_turn && !self.train_wait_turning)
{
entity targ;
vector org;
- targ = find(world, targetname, self.target);
- org = normalize(targ.origin);
- SUB_CalcAngleMove(org, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+ if(self.spawnflags & 1) // bezier curves movement
+ {
+ targ = find(world, targetname, self.target);
+ org = normalize(targ.origin);
+ SUB_CalcAngleMove(org, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+ }
+ else
+ {
+ targ = find(world, targetname, self.target);
+ org = normalize(targ.origin);
+ SUB_CalcAngleMove(org, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+ }
self.train_wait_turning = TRUE;
return;
}