From 7559b9fed1081b834a644acf56f4b59781da1e57 Mon Sep 17 00:00:00 2001 From: Celestar Date: Sat, 11 Dec 2004 12:12:51 +0000 Subject: [PATCH] (svn r1017) Solved a Segfault if a station was built too close to the northern corner --- station_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/station_cmd.c b/station_cmd.c index 6c8bc987d9..56c51ec383 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -283,7 +283,7 @@ static Station *GetClosestStationFromTile(uint tile, uint threshold, byte owner) FOR_ALL_STATIONS(st) { 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; best_station = st; }