From 8d6a7b09fd0f579a827567e99be96a70f41b82ca Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 8 Jun 2008 19:33:34 +0000 Subject: [PATCH] get report management of fdet_done right --- hostside/safety.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hostside/safety.c b/hostside/safety.c index 0f2500f..a5b8504 100644 --- a/hostside/safety.c +++ b/hostside/safety.c @@ -979,6 +979,9 @@ void report_train_position(Train *tra) { static int report_getmovpos(TrackLocation *t, TrackAdvanceContext *c, MovPosComb *use_io) { PredictUserContext *u= c->u; + if (u->done_fdet && t->seg != u->train->foredetect) + /* we must use current posn for foredetect itself */ + u->usecurrentposn= 0; if (!u->usecurrentposn && t->seg->motion) *use_io= movpos_change_intent(t->seg->motion); assert(*use_io>=0); @@ -1001,9 +1004,8 @@ static int report_nextseg(TrackLocation *t, struct TrackAdvanceContext *c, strcat(flags,"*"); if (t->seg->det_ignore) strcat(flags,"."); - if (t->seg == u->train->foredetect) { + if (t->seg == u->train->foredetect && !u->done_fdet) { strcat(flags,"!"); - u->usecurrentposn= 0; u->done_fdet= 1; } -- 2.30.2