diff --git a/brickrail-gui/layout/route/layout_node.gd b/brickrail-gui/layout/route/layout_node.gd index 29e7cec..4369fa4 100644 --- a/brickrail-gui/layout/route/layout_node.gd +++ b/brickrail-gui/layout/route/layout_node.gd @@ -63,6 +63,10 @@ func calculate_routes(reversing_behavior, train_id=null): current_node.collect_edges() for neighbour_id in current_node.edges: var edge = current_node.edges[neighbour_id] + + if LayoutInfo.nodes[neighbour_id].type=="block": + if LayoutInfo.nodes[neighbour_id].obj.disable_train: + continue if train_id != null: var edge_locked = edge.get_locked() diff --git a/brickrail-gui/layout/train/layout_train.gd b/brickrail-gui/layout/train/layout_train.gd index dbfd4f1..066a48d 100644 --- a/brickrail-gui/layout/train/layout_train.gd +++ b/brickrail-gui/layout/train/layout_train.gd @@ -129,7 +129,7 @@ func is_end_of_leg(): return route.get_current_leg().is_complete() func _on_LayoutInfo_random_targets_set(_random_targets): - if LayoutInfo.random_targets and route==null and random_targets: + if LayoutInfo.random_targets and route==null and random_targets and not block.disable_train: find_random_route(false) func update_control_ble_train(): @@ -227,6 +227,8 @@ func get_all_valid_routes(no_locked=true, target_facing=null): continue if not LayoutInfo.nodes[node_id].obj.can_stop: continue + if LayoutInfo.nodes[node_id].obj.disable_train: + continue if target_facing != null and target_facing != LayoutInfo.nodes[node_id].facing: continue if not LayoutInfo.nodes[node_id].obj.random_target: