npf.c
changeset 1248 60d36b03da86
parent 1247 3851739bfd09
child 1299 39c06aba09aa
equal deleted inserted replaced
1247:3851739bfd09 1248:60d36b03da86
   762 	 * because multistop depends on vehicles actually reaching the exact
   762 	 * because multistop depends on vehicles actually reaching the exact
   763 	 * dest_tile, not just any stop of that station.
   763 	 * dest_tile, not just any stop of that station.
   764 	 * So only for train orders to stations we fill fstd->station_index, for all
   764 	 * So only for train orders to stations we fill fstd->station_index, for all
   765 	 * others only dest_coords */
   765 	 * others only dest_coords */
   766 	if ((v->current_order.type) == OT_GOTO_STATION && v->type == VEH_Train) {
   766 	if ((v->current_order.type) == OT_GOTO_STATION && v->type == VEH_Train) {
       
   767 		const Station* st = GetStation(v->current_order.station);
       
   768 		TileIndexDiffC center = {st->trainst_w/2, st->trainst_h/2};
   767 		fstd->station_index = v->current_order.station;
   769 		fstd->station_index = v->current_order.station;
   768 		/* Let's take the center of the station as our target tile for trains */
   770 		/* Let's take the center of the station as our target tile for trains */
   769 		Station* st = GetStation(v->current_order.station);
       
   770 		TileIndexDiffC center = {st->trainst_w/2, st->trainst_h/2};
       
   771 		fstd->dest_coords = TILE_ADD(st->train_tile, ToTileIndexDiff(center));
   771 		fstd->dest_coords = TILE_ADD(st->train_tile, ToTileIndexDiff(center));
   772 	} else {
   772 	} else {
   773 		fstd->dest_coords = v->dest_tile;
   773 		fstd->dest_coords = v->dest_tile;
   774 		fstd->station_index = -1;
   774 		fstd->station_index = -1;
   775 	}
   775 	}