(svn r1968) - Fix: [NPF] Mixed declarations and statements
authormatthijs
Tue, 08 Mar 2005 22:28:59 +0000
changeset 1464 fe5fcc14b2a2
parent 1463 85a05f2da980
child 1465 e595fff78af2
(svn r1968) - Fix: [NPF] Mixed declarations and statements
npf.c
--- a/npf.c	Tue Mar 08 22:21:20 2005 +0000
+++ b/npf.c	Tue Mar 08 22:28:59 2005 +0000
@@ -410,6 +410,8 @@
 
 /* Will find a station identified using the NPFFindStationOrTileData */
 int32 NPFFindStationOrTile(AyStar* as, AyStarNode *node) {
+	NPFFindStationOrTileData* fstd = (NPFFindStationOrTileData*)as->user_target;
+	TileIndex tile = node->tile;
 
 	/* See if we checked this before */
 	if (NPFGetFlag(node, NPF_FLAG_TARGET_CHECKED))
@@ -419,8 +421,6 @@
 
 	/* If GetNeighbours said we could get here, we assume the station type
 	 * is correct */
-	NPFFindStationOrTileData* fstd = (NPFFindStationOrTileData*)as->user_target;
-	TileIndex tile = node->tile;
 	if (
 		(fstd->station_index == -1 && tile == fstd->dest_coords) || /* We've found the tile, or */
 		(IsTileType(tile, MP_STATION) && _map2[tile] == fstd->station_index) /* the station */