From: ian Date: Sun, 4 May 2008 19:48:48 +0000 (+0000) Subject: really prefer existing point position X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=4c4cdee5d39140a207fe8c60eff9a8fb851a9bfa;p=trains.git really prefer existing point position --- diff --git a/hostside/movpos.c b/hostside/movpos.c index 94f4eee..35196c0 100644 --- a/hostside/movpos.c +++ b/hostside/movpos.c @@ -611,18 +611,16 @@ ErrorCode movpos_findcomb_bysegs(Segment *back, Segment *move, Segment *fwd, if (back && !(back==tback || back==tfwd)) continue; if (fwd && !(fwd ==tback || fwd ==tfwd)) continue; - if (movei->n_movfeats>1) { - /* we have to search for the one which is least effort, then */ - tchanges= evaluate_target(move,tcomb,startpoint,0); - if (tchanges >= bestchanges) /* prefer low-numbered movposcombs */ - continue; - if (tchanges==-1) { - tchanges= INT_MAX-1; - /* fall through and update */ - } - } else { - tchanges= 1; - } + /* we have to search for the one which is least effort */ + tchanges= evaluate_target(move,tcomb,startpoint,0); + + if (tchanges==-1) + /* mixed kinds */ + tchanges= INT_MAX-1; + + if (tchanges >= bestchanges) /* prefer low-numbered movposcombs */ + continue; + bestcomb= tcomb; bestchanges= tchanges; } diff --git a/hostside/xs.gdb b/hostside/xs.gdb index 76f606e..44c385f 100644 --- a/hostside/xs.gdb +++ b/hostside/xs.gdb @@ -3,6 +3,6 @@ break vdie break nmra_errchk_fail break predict_problem break safety_panic -break findhead_nextseg +#break findhead_nextseg set args -S+realtime.log shinkansen.speeds.record homes.record run