chiark / gitweb /
more backwardsness bugfix
authorian <ian>
Sun, 20 Jul 2008 17:46:05 +0000 (17:46 +0000)
committerian <ian>
Sun, 20 Jul 2008 17:46:05 +0000 (17:46 +0000)
hostside/safety.c

index 39043b0c6038fde089d18c8aa8b42934ffecc2ae..5b1ecd996c887a17852063328d338a1a8a6867ba 100644 (file)
@@ -1062,6 +1062,14 @@ void report_train_ownerships(Train *tra, Segment *hindmost,
 static int reverse_nextseg(TrackLocation *t, struct TrackAdvanceContext *c,
                           MovPosComb *mpc_io, const TrackLocation *before) {
   PredictUserContext *u= c->u;
+
+  DPRINTF(safety,predictseg,"   reverse_nextseg "
+         " %c%s dist=%-4d\n",
+
+         " -"[t->backwards],
+         t->seg->i->pname,
+         c->distance);
+
   if (*mpc_io==-1 || t->seg->motion)
     return predict_problem(u,t->seg, "segment under train is not stable");
   return 0;
@@ -1104,7 +1112,7 @@ ErrorCode safety_setdirection(Train *tra, int backwards,
   
   newfdet.seg= tra->foredetect;
   newfdet.remain= tra->maxinto;
-  newfdet.backwards= !tra->backwards;
+  newfdet.backwards= !tra->foredetect->tr_backwards;
 
   c.distance= tra->detectable + tra->uncertainty;
   c.nextseg= reverse_nextseg;