station_cmd.c
changeset 1472 043304846688
parent 1457 6a8ca2f51a8b
child 1477 2174a73b11c9
--- a/station_cmd.c	Wed Mar 09 18:19:13 2005 +0000
+++ b/station_cmd.c	Wed Mar 09 19:09:04 2005 +0000
@@ -343,10 +343,10 @@
 	/* check mine? */
 	if (HASBIT(free_names, M(STR_SV_STNAME_MINES))) {
 		if (CountMapSquareAround(tile, MP_INDUSTRY, 0, 6) >= 2 ||
-		    CountMapSquareAround(tile, MP_INDUSTRY, 0x64, 0x73) >= 2 ||
-		    CountMapSquareAround(tile, MP_INDUSTRY, 0x2F, 0x33) >= 2 ||
-		    CountMapSquareAround(tile, MP_INDUSTRY, 0x48, 0x58) >= 2 ||
-		    CountMapSquareAround(tile, MP_INDUSTRY, 0x5B, 0x63) >= 2) {
+				CountMapSquareAround(tile, MP_INDUSTRY, 0x64, 0x73) >= 2 ||
+				CountMapSquareAround(tile, MP_INDUSTRY, 0x2F, 0x33) >= 2 ||
+				CountMapSquareAround(tile, MP_INDUSTRY, 0x48, 0x58) >= 2 ||
+				CountMapSquareAround(tile, MP_INDUSTRY, 0x5B, 0x63) >= 2) {
 			found = M(STR_SV_STNAME_MINES);
 			goto done;
 		}
@@ -362,18 +362,20 @@
 	}
 
 	/* Check lakeside */
-	if (HASBIT(free_names, M(STR_SV_STNAME_LAKESIDE))
-	    && DistanceFromEdge(tile) < 20
-	    && CountMapSquareAround(tile, MP_WATER, 0, 0) >= 5) {
+	if (HASBIT(free_names, M(STR_SV_STNAME_LAKESIDE)) &&
+			DistanceFromEdge(tile) < 20 &&
+			CountMapSquareAround(tile, MP_WATER, 0, 0) >= 5) {
 		found = M(STR_SV_STNAME_LAKESIDE);
 		goto done;
 	}
 
 	/* Check woods */
-	if (HASBIT(free_names, M(STR_SV_STNAME_WOODS)) &&
-	    (CountMapSquareAround(tile, MP_TREES, 0, 255) >= 8 ||
-	     CountMapSquareAround(tile, MP_INDUSTRY, 0x10, 0x11) >= 2)) {
-		found = (_opt.landscape==LT_DESERT) ? M(STR_SV_STNAME_FOREST) : M(STR_SV_STNAME_WOODS);
+	if (HASBIT(free_names, M(STR_SV_STNAME_WOODS)) && (
+				CountMapSquareAround(tile, MP_TREES, 0, 255) >= 8 ||
+				CountMapSquareAround(tile, MP_INDUSTRY, 0x10, 0x11) >= 2)
+			) {
+		found = _opt.landscape == LT_DESERT ?
+			M(STR_SV_STNAME_FOREST) : M(STR_SV_STNAME_WOODS);
 		goto done;
 	}
 
@@ -889,11 +891,12 @@
 // stolen from TTDPatch
 static void GetStationLayout(byte *layout, int numtracks, int plat_len, struct StationSpec *spec)
 {
-	if (spec != NULL && spec->lengths >= plat_len && spec->platforms[plat_len - 1] >= numtracks
-	    && spec->layouts[plat_len - 1][numtracks - 1]) {
+	if (spec != NULL && spec->lengths >= plat_len &&
+			spec->platforms[plat_len - 1] >= numtracks &&
+			spec->layouts[plat_len - 1][numtracks - 1]) {
 		/* Custom layout defined, follow it. */
 		memcpy(layout, spec->layouts[plat_len - 1][numtracks - 1],
-		       plat_len * numtracks);
+			plat_len * numtracks);
 		return;
 	}
 
@@ -1181,8 +1184,8 @@
 		int i;
 
 		for (i = 0; i <= _statspec_highest_id[sclass]; i++) {
-			if (_station_spec[sclass][i].grfid == spec->grfid
-			    && _station_spec[sclass][i].localidx == local_stid + 1) {
+			if (_station_spec[sclass][i].grfid == spec->grfid &&
+					_station_spec[sclass][i].localidx == local_stid + 1) {
 				stid = i;
 				/* FIXME: Release original SpriteGroup to
 				 * prevent leaks. But first we need to
@@ -1251,8 +1254,7 @@
 					/* TODO: Town structure. */
 
 				} else /* VSG_SELF */ {
-					if (dsg->variable == 0x40
-					    || dsg->variable == 0x41) {
+					if (dsg->variable == 0x40 || dsg->variable == 0x41) {
 						/* FIXME: This is ad hoc only
 						 * for waypoints. */
 						value = 0x01010000;
@@ -1313,7 +1315,7 @@
 	}
 
 	error("Custom station 0x%08x::0x%02x has no sprites associated.",
-	       spec->grfid, spec->localidx);
+		spec->grfid, spec->localidx);
 	/* This is what gets subscribed of dtss->image in newgrf.c,
 	 * so it's probably kinda "default offset". Try to use it as
 	 * emergency measure. */
@@ -3104,8 +3106,7 @@
 		}
 	}
 
-	/* This is to ensure all pointers are within the limits of
-	    _stations_size */
+	/* This is to ensure all pointers are within the limits of _stations_size */
 	if (_station_tick_ctr > GetStationPoolSize())
 		_station_tick_ctr = 0;
 }