layout.get_driver().set_turnout(turnout_id, p);
}
+float Track::get_path_length(int p) const
+{
+ if(p<0)
+ p = active_path;
+ return type.get_path_length(p);
+}
+
OrientedPoint Track::get_point(unsigned epi, unsigned path, float d) const
{
OrientedPoint p = type.get_point(epi, path, d);
return false;
links[i] = 0;
- other->break_link(*this);
- // XXX Creates the blocks twice, because the other track calls this too
- layout.create_blocks(*this);
+ if(!other->break_link(*this))
+ {
+ /* If the call doesn't succeed, it means that the other track already
+ broke the link and is calling us right now. Recreate blocks in the inner
+ call so it occurs before any signals are emitted. */
+ layout.create_blocks(*this);
+ }
+
signal_link_changed.emit(i, 0);
return true;