Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upFindStationsAroundTiles with use_nearby=true returns no results for industry tiles #7372
Comments
This comment has been minimized.
This comment has been minimized.
Weird, I remember seeing this but must have forgotten :-( |
This comment has been minimized.
This comment has been minimized.
Now that I look, the only affected caller of this is newgrf houses querying cargo acceptance history of nearby stations with var 0x64, and only if they provide an offset which points to an industry tile. I'm not sure what the purpose of this check (with an offset) is, and I suspect providing the result of the industry's nearby stations is incorrect at this point. |
This comment has been minimized.
This comment has been minimized.
Okay, so it's for multi-tile buildings to check the for other possible stations of their other tiles. Basically this bug is a non-issue as checking an industry tile wouldn't produce useful results anyway. |
…esult for industry tiles. This can only be triggered by NewGRF house tiles querying for cargo acceptance history of nearby stations (var 0x64) with a tile offset. This serves no useful purpose.
…esult for industry tiles. Currently this can only be triggered by NewGRF house tiles querying for cargo acceptance history of nearby stations (var 0x64) with a tile offset, and providing an offset that happens to point to an industry tile. This serves no useful purpose.
Version of OpenTTD
Since 8b1b3fd
Expected result
void FindStationsAroundTiles(const TileArea &location, StationList *stations, bool use_nearby)
should fill *stationsActual result
When use_nearby is true and
IsTileType(location.tile, MP_INDUSTRY)
.stations = &Industry::GetByTile(location.tile)->stations_near;
changes the value of the stations parameter pointer.This does not write to *stations, and the change of pointer is not visible to the caller.
Presumably it should be
*stations = Industry::GetByTile(location.tile)->stations_near;
Steps to reproduce