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
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
douiwby pushed a commit to douiwby/OpenTTD that referenced this issue Apr 16, 2020
spnda pushed a commit to spnda/OpenTTD that referenced this issue Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants