changeset 595:c3d73f673b20 draft

(svn r1017) Solved a Segfault if a station was built too close to the northern corner
author Celestar <Celestar@openttd.org>
date Sat, 11 Dec 2004 12:12:51 +0000
parents 5b0fe7c559c9
children 890611f300f7
files station_cmd.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -283,7 +283,7 @@
 
 	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;
 		}