mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 22:28:56 +00:00
(svn r1017) Solved a Segfault if a station was built too close to the northern corner
This commit is contained in:
parent
f995fd08a1
commit
7559b9fed1
@ -283,7 +283,7 @@ static Station *GetClosestStationFromTile(uint tile, uint threshold, byte owner)
|
|||||||
|
|
||||||
FOR_ALL_STATIONS(st) {
|
FOR_ALL_STATIONS(st) {
|
||||||
cur_dist = GetTileDist(tile, st->xy);
|
cur_dist = GetTileDist(tile, st->xy);
|
||||||
if (cur_dist < threshold && (owner == 0xFF || st->owner == owner)) {
|
if (cur_dist < threshold && (owner == 0xFF || st->owner == owner) && (st->xy != 0)) {
|
||||||
threshold = cur_dist;
|
threshold = cur_dist;
|
||||||
best_station = st;
|
best_station = st;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user