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

Station walking extends beyond station spread. #388

Closed
DorpsGek opened this issue Nov 5, 2006 · 8 comments
Closed

Station walking extends beyond station spread. #388

DorpsGek opened this issue Nov 5, 2006 · 8 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Nov 5, 2006

Anonymous opened the ticket and wrote:

As reported in http://www.tt-forums.net/viewtopic.php?t=28226&postdays=0&postorder=asc&start=0, this was classed as "Not a Bug", and " To "fix" we need to rework the whole station concept together with catchment area"

Since this can be used to cheat in multiplayer games, and allow players a unfair advantage, I hope get this reclassified as a bug. This can be easily fixed by changing the following function: CheckStationSpreadOut.

If CheckStationSpreadOut is changed to:

TileIndex stationTile = st->xy;
uint x1 = TileX(stationTile);
uint y1 = TileY(stationTile);
uint x2 = TileX(tile);
uint y2 = TileY(tile);
uint t;

if (x2<x1){ //The tile we are checking is before the station
t = x2;
x2 = x1;
x1 = t;
}
if (y2<y1){ //The tile we are checking is before the station
t = y2;
y2 = y1;
y1 = t;
}
if (y2 - y1 >= _patches.station_spread || x2 - x1 >= _patches.station_spread) {
_error_message = STR_306C_STATION_TOO_SPREAD_OUT;
return false;
}

return true;

This would give the station size a max limit of _patches.station_spread from the original station sign, "fixing" this problem. I have compiled the source with this, and it does give the desired effect. Changing the function to a derivitive of this would stop this problem in multiplayer.

Willisterman

Reported version: trunk
Operating system: All


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

HMage wrote:

I've created a .patch for better readability and ease integration.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/388#comment633

@DorpsGek
Copy link
Member Author

KUDr wrote:

Not a bug that you can move your station by walking. I can offer to fix it so, that station sign will move along with the station. Would it be ok then?


This comment was imported from FlySpray: https://bugs.openttd.org/task/388#comment635

@DorpsGek
Copy link
Member Author

HMage wrote:

I think that would be ok - will stop people cheating.


This comment was imported from FlySpray: https://bugs.openttd.org/task/388#comment636

@DorpsGek
Copy link
Member Author

KUDr wrote:

cheating? How they can cheat with it? They can only pretend that the station is here while it is there, but I wouldn't call it cheating.


This comment was imported from FlySpray: https://bugs.openttd.org/task/388#comment637

@DorpsGek
Copy link
Member Author

HMage wrote:

As far as I understand - station distance for money caluclations is done using sign positions.

For example, you can build a station at the corner of the map and then walk it to opposite corner to a city, and then serve passengers from another nearby city, you'll get money as if you had travelled all along the way from one corner to another.


This comment was imported from FlySpray: https://bugs.openttd.org/task/388#comment638

@DorpsGek
Copy link
Member Author

HMage wrote:

Attached to this message is a 0.4.8 savegame that exploits this.


This comment was imported from FlySpray: https://bugs.openttd.org/task/388#comment639

@DorpsGek
Copy link
Member Author

KUDr wrote:

Ahh yes, this bug. I had in mind the catch area cheating.


This comment was imported from FlySpray: https://bugs.openttd.org/task/388#comment640

@DorpsGek
Copy link
Member Author

KUDr closed the ticket.

Reason for closing: Fixed

r7169


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

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 6, 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/)
Projects
None yet
Development

No branches or pull requests

1 participant