need_polarise:1, /* when we commit */
train_polarity_inverted:1, /* right now, or if know_best, the best */
know_best_polarity:1, /* longest-lasting into the future */
- alwaysusemotions:1; /* for report_train_ownerships only */
+ alwaysusemotions:1; /* for report_train_ownerships only */
TrackLocation nose, fdet, tail;
TrackAdvanceContext nosec, tailc, fdetc;
TimeInterval elapsed; /* from now, minimum */
MovPosComb *use_io) {
PredictUserContext *u= c->u;
if (u->usecurrentposn) return 0;
- if (t->seg->motion) *use_io= movpos_change_intent(t->seg->motion);
+ if (t->seg->motion)
+ if (t->seg->moving || t->seg->pred_vacated || u->alwaysusemotions)
+ *use_io= movpos_change_intent(t->seg->motion);
if (*use_io<0) safety_panic(u->train, t->seg,
"track route unexpectedly not known");
return 0;
}
/* Now we have advanced the nose and have recorded any appropriate
- * motion(s). But we advancing the nose has updated the segment's
+ * motion(s). Advancing the nose has updated the segment's
* notion of the motion but not trackloc_advance's cached version of
- * the movposcomb in *mpc_io. That doesn't matter because we don't
- * actually use it ourselves and trackloc_advance will call
- * getmovpos. */
+ * the movposcomb in *mpc_io - but trackloc_advance will call
+ * pred_getmovpos right after we return so we do not need to worry.
+ */
/* Check polarity */
assert(foredet);
u.walk_compute_polarise= 1;
- u.train_polarity_inverted= foredet->seg_inverted ^ foredet->tr_backwards;
u.usecurrentposn= 1;
+ u.train_polarity_inverted= foredet->seg_inverted ^ foredet->tr_backwards;
/*----- find the train's foredetect (rearmost possibility) -----*/
/*
/*----- find the train's nose (rearmost possibility) -----*/
+ u.usecurrentposn= 0;
u.nosec.u= &u;
u.nosec.getmovpos= pred_getmovpos;
u.nosec.nextseg= nose_nextseg;