chiark / gitweb /
proper handling of tail-eating ownership
authorian <ian>
Sun, 4 May 2008 21:50:56 +0000 (21:50 +0000)
committerian <ian>
Sun, 4 May 2008 21:50:56 +0000 (21:50 +0000)
hostside/safety.c
hostside/xs.gdb

index 4ff02bf5a1e64ebe02894ce126b97c01d0ef46ce..859465d361ca2a7e515ce32288beb6ff77e66f50 100644 (file)
@@ -592,10 +592,12 @@ static int report_nextseg(TrackLocation *t, struct TrackAdvanceContext *c,
   int r;
 
   if (t->seg->owner != u->train) return -1;
-  if (u->usecurrentposn && !t->seg->det_ignore)
+  if (t->seg == u->furthest) {
     /* We've gone back past our own tail into the place where our
-     * head is going to be in the far future.  Confusing, eh ? */
+     * head is going to be in the far future.   */
+    oprintf(UPO, " ...");
     return -1;
+  }
 
   flags[0]= 0;
 
@@ -627,7 +629,7 @@ void report_train_ownerships(Train *tra, Segment *furthest,
 
   memset(&u,0,sizeof(u));
   u.train= tra;
-  u.furthest= furthest;
+  u.furthest= 0;
   u.usecurrentposn= 0;
   u.forceusemotions= force_use_motions;
   
@@ -645,7 +647,10 @@ void report_train_ownerships(Train *tra, Segment *furthest,
 
   mpc= furthest->movposcomb;
   r= report_nextseg(&u.tail,&u.tailc,&mpc,0);  assert(!r);
+
+  u.furthest= furthest;
   trackloc_advance(&u.tail,&u.tailc);
+
   oprintf(UPO, "\n");
 }
   
index 44c385f617cb3d9e87a7fe474be5af6fbbeea2a2..c91a039a874b21b5493db0d66f1febe19301b879 100644 (file)
@@ -3,6 +3,7 @@ break vdie
 break nmra_errchk_fail
 break predict_problem
 break safety_panic
+break obc_error
 #break findhead_nextseg
 set args -S+realtime.log shinkansen.speeds.record homes.record 
 run