Skip to content

Commit

Permalink
Merge pull request #1125 from CitiesSkylinesMods/bugfix/1124-lane-rou…
Browse files Browse the repository at this point in the history
…ting-recalculation-invalid-segment

Ignore invalid (disconnected) segments while calculating lane routings
  • Loading branch information
krzychu124 committed Jun 16, 2021
2 parents f9654c0 + dabc10f commit 2615dbe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions TLM/TLM/Manager/Impl/RoutingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace TrafficManager.Manager.Impl {
using TrafficManager.State.ConfigData;
using TrafficManager.State;
using TrafficManager.Util;
using UnityEngine;

public class RoutingManager
: AbstractGeometryObservingManager,
Expand Down Expand Up @@ -460,8 +461,13 @@ public class RoutingManager
continue;
}

bool start = (bool)Constants.ServiceFactory.NetService.IsStartNode(segId, nextNodeId);
ExtSegmentEnd segEnd = segEndMan.ExtSegmentEnds[segEndMan.GetIndex(segId, start)];
bool? start = Constants.ServiceFactory.NetService.IsStartNode(segId, nextNodeId);
if (!start.HasValue) {
Log.Error($"Segment with id: {segId} is not connected to the node {nextNodeId}");
Debug.LogError($"TM:PE RecalculateLaneRoutings - Segment with id {segId} is not connected to the node {nextNodeId}");
continue;
}
ExtSegmentEnd segEnd = segEndMan.ExtSegmentEnds[segEndMan.GetIndex(segId, start.Value)];

if (segEnd.incoming) {
++numIncoming;
Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/Util/VersionUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static class VersionUtil {
// we could alternatively use BuildConfig.APPLICATION_VERSION because const values are evaluated at compile time.
// but I have decided not to do this because I don't want this to happen automatically with a rebuild if
// CS updates. these values should be changed manaually so as to force us to acknowledge that they have changed.
public const uint EXPECTED_GAME_VERSION_U = 188868624U;
public const uint EXPECTED_GAME_VERSION_U = 189262096U;

// see comments for EXPECTED_GAME_VERSION_U.
public static Version ExpectedGameVersion => new Version(1, 13, 3, 9);
Expand Down

0 comments on commit 2615dbe

Please sign in to comment.