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
Add: Road waypoints #12572
base: master
Are you sure you want to change the base?
Add: Road waypoints #12572
Conversation
5696fe1
to
2e20275
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't dug deeply or tested this, but I found some things in my first read-through of the code.
9087751
to
b3408bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the last commit is going to conflict with #12595.
src/station_cmd.cpp
Outdated
if (ret.Failed()) return ret; | ||
} | ||
|
||
/* don't do the check for drive-through road stops when company bankrupts */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* don't do the check for drive-through road stops when company bankrupts */ | |
/* Ignore vehicles when the company bankrupts. The road will remain, any vehicles going to the waypoint will be removed. */ |
src/station_cmd.cpp
Outdated
if (IsDriveThroughStopTile(tile)) { | ||
CommandCost remove_road = CanRemoveRoadWithStop(tile, flags); | ||
if (remove_road.Failed()) return remove_road; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a copy-paste mistake. Why would road waypoints also be drive through stops?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the condition is redundant here as all road waypoints are drive-through. (Bay waypoints would be a bit useless).
I'll fix this later,
If that is merged first then I'll redo the UI stuff accordingly at some point. |
Move can station have wires bit to make room
Motivation / Problem
Add road waypoints, and corresponding NewGRF support: action 5 and custom road stops via feature 0x14
Description
Add road waypoint functionality, road waypoint default graphics, custom road waypoint GRF support, road waypoint selection window. Adjust map bit allocations as required.
For testing, the existing GRF on bananas: Road Stops & No Waypoints has waypoints, despite the name. With this PR applied the road waypoint part of this GRF "just works" as expected.
Limitations
For lack of a better choice, road waypoints use the PR_BUILD_STATION_TRUCK and PR_CLEAR_STATION_TRUCK basecost categories. Adding more basecost categories seems unnecessarily disruptive to basecost GRFs/the spec.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.