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

Simplify GetOrderCmdFromTile #6059

Closed
DorpsGek opened this issue Jul 10, 2014 · 1 comment
Closed

Simplify GetOrderCmdFromTile #6059

DorpsGek opened this issue Jul 10, 2014 · 1 comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

juanjo opened the ticket and wrote:

First, IsDepotTypeTile can also work for TRANSPORT_AIR. It doesn't introduce problems. In all calls to this function, IsDepotTypeTile is never called for air transport at the moment.

If that first patch can be accepted, then GetOrderCmdFromTile can be simplified for depots. Unfortunately, there is one line I have problems with. I don't know how to convert a VehicleTypeByte directly into a TransportType type:
if (IsDepotTypeTile(tile, (TransportType)(uint)v->type) && IsTileOwner(tile, _local_company)) {
I would appreciate help from developers in this point.

The rest of the patch are minor codechanges:
If we need the index of a rail waypoint, we don't need the waypoint itself.
To be consistent with the rest of the funciton, user cannot create an order to a waypoint of another company. (Keep in mind buoys have no owner)
Lastly, there is no need to "free" ("do nothing" order) at the end, as the order is already "free" from the beginning.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6059
@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Implemented

in r26692 and r26693


This comment was imported from FlySpray: https://bugs.openttd.org/task/6059

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant