PredictUserContext *u= c->u;
pred_callback_debug(" initpresent_nextseg",t,c,before);
t->seg->now_present= t->seg->pred_present= t->seg->will_polarise= 1;
+ t->seg->tr_backwards= !t->backwards;
t->seg->until= 0;
if (!t->seg->i->invertible)
u->noninv_tally[!t->backwards]++; /* ! since going backwards along train */
oldmaxinto= tra->maxinto;
r= trackloc_getlink(&newfdet,&c,&pci,0,-1); assert(!r);
+
tra->foredetect= newfdet.seg;
tra->maxinto= pci->dist - newfdet.remain;
+ tra->backwards ^= 1;
+ newfdet.seg->tr_backwards ^= 1;
ec= predict(tra,tnow, PREDF_NEWPLAN,0,0, ppc,ppcu);
if (!ec) {
tra->foredetect= oldfdet;
tra->maxinto= oldmaxinto;
+ tra->backwards ^= 1;
+ newfdet.seg->tr_backwards ^= 1; /* in case it's the same as oldfdet */
+
ec2= predict(tra,tnow, 0,0,0, 0,(char*)"abandon reverse");
assert(!ec2);