(svn r1017) Solved a Segfault if a station was built too close to the northern corner
authorCelestar
Sat, 11 Dec 2004 12:12:51 +0000
changeset 595 927120a39a1f
parent 594 1b51f81b4a77
child 596 a787fc8fba4a
(svn r1017) Solved a Segfault if a station was built too close to the northern corner
station_cmd.c
--- a/station_cmd.c	Sat Dec 11 11:00:54 2004 +0000
+++ b/station_cmd.c	Sat Dec 11 12:12:51 2004 +0000
@@ -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;
 		}