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
FindStationsAroundTiles with use_nearby=true returns no results for industry tiles #7372
Comments
Weird, I remember seeing this but must have forgotten :-( |
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. |
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.
…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
The text was updated successfully, but these errors were encountered: