public bool GetDefaultEnteringBlockedJunctionAllowed(ushort segmentId, bool startNode, ref NetNode node) { #if DEBUG bool debug = GlobalConfig.Instance.Debug.Switches[11]; #endif SegmentEndGeometry endGeo = SegmentGeometry.Get(segmentId)?.GetEnd(startNode); if (endGeo == null) { Log.Warning($"JunctionRestrictionsManager.GetDefaultEnteringBlockedJunctionAllowed({segmentId}, {startNode}): Could not get segment end geometry"); return(false); } if (!IsEnteringBlockedJunctionAllowedConfigurable(segmentId, startNode, ref node)) { bool res = (node.m_flags & (NetNode.Flags.Junction | NetNode.Flags.OneWayOut | NetNode.Flags.OneWayIn)) != NetNode.Flags.Junction || node.CountSegments() == 2; #if DEBUG if (debug) { Log._Debug($"JunctionRestrictionsManager.GetDefaultEnteringBlockedJunctionAllowed({segmentId}, {startNode}): Setting is not configurable. res={res}, flags={node.m_flags}, node.CountSegments()={node.CountSegments()}"); } #endif return(res); } bool ret; if (Options.allowEnterBlockedJunctions) { ret = true; } else { int numOutgoing = 0; int numIncoming = 0; node.CountLanes(endGeo.NodeId(), 0, NetInfo.LaneType.Vehicle | NetInfo.LaneType.TransportVehicle, VehicleInfo.VehicleType.Car, true, ref numOutgoing, ref numIncoming); ret = numOutgoing == 1 || numIncoming == 1; } #if DEBUG if (debug) { Log._Debug($"JunctionRestrictionsManager.GetDefaultEnteringBlockedJunctionAllowed({segmentId}, {startNode}): Setting is configurable. ret={ret}"); } #endif return(ret); }