OpenTTD

Tasklist

FS#388 - Station walking extends beyond station spread.

Attached to Project: OpenTTD
Opened by Anonymous Submitter - Sunday, 05 November 2006, 22:47 GMT
Last edited by KUDr (KUDr) - Thursday, 16 November 2006, 14:36 GMT
Type Bug
Category Core
Status Closed
Assigned To KUDr (KUDr)
Operating System All
Severity Very Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

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
This task depends upon

Closed by  KUDr (KUDr)
Thursday, 16 November 2006, 16:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  r7169
Comment by HMage (HMage) - Thursday, 16 November 2006, 00:18 GMT
I've created a .patch for better readability and ease integration.
Comment by KUDr (KUDr) - Thursday, 16 November 2006, 14:31 GMT
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?
Comment by HMage (HMage) - Thursday, 16 November 2006, 15:00 GMT
I think that would be ok - will stop people cheating.
Comment by KUDr (KUDr) - Thursday, 16 November 2006, 15:09 GMT
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.
Comment by HMage (HMage) - Thursday, 16 November 2006, 15:16 GMT
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.
Comment by HMage (HMage) - Thursday, 16 November 2006, 15:53 GMT
Attached to this message is a 0.4.8 savegame that exploits this.
Comment by KUDr (KUDr) - Thursday, 16 November 2006, 16:13 GMT
Ahh yes, this bug. I had in mind the catch area cheating.

Loading...