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

LeftHandDrive returns Right hand drive #577

Closed
kianzarrin opened this issue Nov 29, 2019 · 5 comments · Fixed by #580
Closed

LeftHandDrive returns Right hand drive #577

kianzarrin opened this issue Nov 29, 2019 · 5 comments · Fixed by #580
Labels
adjustments required An issue require some adjustments in code Annoyance Not a bug, but just as annoying code cleanup Refactor code, remove old code, improve maintainability
Milestone

Comments

@kianzarrin
Copy link
Collaborator

kianzarrin commented Nov 29, 2019

Currently Left hand drive is implemented like this:

        public bool LeftHandDrive =>
            Singleton<SimulationManager>.instance.m_metaData.m_invertTraffic
            == SimulationMetaData.MetaBool.True;

I suppose who ever wrote this confused left hand drive with left hand traffic.

I suggest the following fix.

        //make this [Obsolete]
        public bool LeftHandDrive => LeftHandTraffic; // Intentionally wrong for legacy reasons.

        public bool LeftHandTraffic =>
            Singleton<SimulationManager>.instance.m_metaData.m_invertTraffic
            == SimulationMetaData.MetaBool.True;

I didn't remove Left hand drive because I don't want to make too many changes in the code. note that the variable names may also need an update.

@kianzarrin kianzarrin added BUG Defect detected triage Awaiting issue categorisation labels Nov 29, 2019
@originalfoo originalfoo added adjustments required An issue require some adjustments in code Annoyance Not a bug, but just as annoying code cleanup Refactor code, remove old code, improve maintainability and removed BUG Defect detected triage Awaiting issue categorisation labels Nov 29, 2019
@originalfoo
Copy link
Member

Rather than have something intentionally wrong, why not just do a find and replace across the entire source of the mod?

Also, I think it would be much less ambiguous if it was named TrafficDrivesOnLeft to divest from the often confused terms such as LHT/RHD vs. RHT/LHD.

@originalfoo originalfoo added this to the 11.0 milestone Nov 29, 2019
@kianzarrin
Copy link
Collaborator Author

@aubergine10 you will need to search and replace a lot of variable names too.

@originalfoo
Copy link
Member

I think it will be worth doing, to avoid future confusion. We (well, kvakvs specifically) did a lot of similar code clean up shortly after migration to Harmony framework just to improve overall maintainability of the codebase.

@originalfoo
Copy link
Member

I can have a look at doing the bulk update later today, if you want?

@kianzarrin
Copy link
Collaborator Author

@aubergine10 that would be nice.

kianzarrin added a commit to kianzarrin/Cities-Skylines-Traffic-Manager-President-Edition that referenced this issue Jan 19, 2020
…HandTraffic.

search for duplicated nodes inorder to check for roundabout.
polish + documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adjustments required An issue require some adjustments in code Annoyance Not a bug, but just as annoying code cleanup Refactor code, remove old code, improve maintainability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants