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

Fix for power/running cost sorting algorithm. #7561

Closed
dorobouNeko opened this issue May 3, 2019 · 1 comment
Closed

Fix for power/running cost sorting algorithm. #7561

dorobouNeko opened this issue May 3, 2019 · 1 comment

Comments

@dorobouNeko
Copy link
Contributor

@dorobouNeko dorobouNeko commented May 3, 2019

The algorithm assumes that running cost (in GBP) is always higher than power, which is not always true.
Solution would be to make the division and compare two floats, with enough precision. Also take into account zero running cost when dividing.
I would code this but my c++ is kinda rusty and i bet someone else could make this much more elegant and consistent with the project.

dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 5, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 5, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 5, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 6, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 6, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 6, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 6, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 6, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 6, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 6, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 6, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 6, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 14, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 16, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue May 16, 2019
@MingweiSamuel

This comment has been minimized.

Copy link
Contributor

@MingweiSamuel MingweiSamuel commented May 29, 2019

(link: #7573)

dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue Jun 9, 2019
dorobouNeko added a commit to dorobouNeko/OpenTTD that referenced this issue Jun 9, 2019
@LordAro LordAro closed this in cbefc1d Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.