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

CA_TRUCK used while creating a BUS station #5449

Closed
DorpsGek opened this issue Jan 25, 2013 · 6 comments
Closed

CA_TRUCK used while creating a BUS station #5449

DorpsGek opened this issue Jan 25, 2013 · 6 comments
Labels
component: interface This is an interface issue 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

ComLock opened the ticket and wrote:

While creating a BUS station, the catchment area displayed is CA_TRUCK, not CA_BUS.
After the BUS station is created, catchment ares is actually CA_BUS which is correct.

Here's a patch to fix it. (BTW Is there a better way to commit patches?)

Index: src/road_gui.cpp

--- src/road_gui.cpp (revision 24940)
+++ src/road_gui.cpp (working copy)
@@ -956,8 +956,7 @@
virtual void OnPaint()
{
this->DrawWidgets();
-
- int rad = _settings_game.station.modified_catchment ? CA_TRUCK /* = CA_BUS */ : CA_UNMODIFIED;
+ int rad = _settings_game.station.modified_catchment ? ((this->window_class == WC_BUS_STATION) ? CA_BUS : CA_TRUCK) : CA_UNMODIFIED;
if (_settings_client.gui.station_show_coverage) {
SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
} else {

Reported version: trunk
Operating system: All


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

ComLock wrote:

Seems I must add a comment to attach a file, here you go.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5449#comment11905

@DorpsGek
Copy link
Member Author

ComLock wrote:

Patch #5453 includes this bugfix.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5449#comment11911

@DorpsGek
Copy link
Member Author

Zuu wrote:

In trunk, CA_TRUCK and CA_BUS are equal, just as noted in the comment. Thus you don't really fix a problem in trunk. However, if these two constants would have different values, your change is correct.

Thus as a pre-step or codechange before your #5453 patch, this patch is a good separation of preparation steps and a feature introducing patch. Eg. alone, it only fixes a theoretical problem of some code that has probably not changed in ages. But as part of a patch queue for your new features, it is a very good idea to keep this step a separate patch.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5449#comment11916

@DorpsGek
Copy link
Member Author

Zuu wrote:

Oh, and please don't remove white lines for no good purpose as you did in this patch.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5449#comment11917

@DorpsGek
Copy link
Member Author

juanjo wrote:

CA_TRUCK and CA_BUS have the same value in trunk. But as variables they do not represent the same thing. So the patch solves a conceptual bug that was never noticed due to CA_TRUCK == CA_BUS.

If bus and truck catchment area must be the same, then we should replace CA_TRUCK and CA_BUS to CA_ROAD_VEHICLE.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5449#comment11918

@DorpsGek
Copy link
Member Author

Zuu closed the ticket.

Reason for closing: Implemented

In r24948. Thanks for the patch.


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

@DorpsGek DorpsGek added component: interface This is an interface issue 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
component: interface This is an interface issue 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