Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect segment id for direction calculations #1606

Merged
merged 2 commits into from
Jun 23, 2022

Conversation

krzychu124
Copy link
Member

@krzychu124 krzychu124 commented Jun 22, 2022

Fixed the code since it does not make any sense when node id was not passed as argument - it suppose to calculate the id by taking shared node - ID 0 is always reserved and used as "Empty/Invalid".

That method is currently used in two places in both cases we pass node Id so this change doesn't really improve anything but will prevent bugs if someone try to use it without explicitly passing the node id.

@krzychu124 krzychu124 added BUG Defect detected LANE ROUTING Feature: Lane arrows / connectors labels Jun 22, 2022
@krzychu124 krzychu124 added this to the 11.6.6.0 milestone Jun 22, 2022
@krzychu124 krzychu124 self-assigned this Jun 22, 2022
@@ -170,7 +170,7 @@ public class ExtSegmentEndManager

public ArrowDirection GetDirection(ushort segmentId0, ushort segmentId1, ushort nodeId = 0) {
if (nodeId == 0) {
ref NetSegment netSegment = ref ((ushort)0).ToSegment();
ref NetSegment netSegment = ref segmentId0.ToSegment();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol where did ((ushort)0) came from?!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
automated search and replace I suppose.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was the one who wrote the previous code.

@krzychu124 krzychu124 merged commit 0844044 into master Jun 23, 2022
@krzychu124 krzychu124 deleted the bugfix/arrow-direction-calculation branch June 23, 2022 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Defect detected LANE ROUTING Feature: Lane arrows / connectors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants