protocol(p),
priority(0),
yielding_to(0),
+ preceding_train(0),
cur_blocks_end(blocks.end()),
clear_blocks_end(blocks.end()),
pending_block(0),
BlockIter start = blocks.back();
pending_block = 0;
+ preceding_train = 0;
// See how many sensor blocks and how much track we already have
unsigned nsens = 0;
bool entry_conflict = (block.entry()==other_exit);
bool exit_conflict = (exit==static_cast<unsigned>(other_entry));
if(!entry_conflict && !last->get_turnout_id())
+ {
/* The other train is not coming to the blocks we're holding, so we
can keep them. */
good_end = blocks.end();
+ if(static_cast<unsigned>(other_entry)==block.entry())
+ preceding_train = other_train;
+ }
+
int other_prio = other_train->get_priority();
if(!entry_conflict && !exit_conflict && other_prio<priority)