summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npf.c4
-rw-r--r--ttd.dsp8
-rw-r--r--ttd.vcproj6
3 files changed, 16 insertions, 2 deletions
diff --git a/npf.c b/npf.c
index 430c03ebb..c8b456c20 100644
--- a/npf.c
+++ b/npf.c
@@ -764,10 +764,10 @@ void NPFFillWithOrderData(NPFFindStationOrTileData* fstd, Vehicle* v) {
* So only for train orders to stations we fill fstd->station_index, for all
* others only dest_coords */
if ((v->current_order.type) == OT_GOTO_STATION && v->type == VEH_Train) {
+ const Station* st = GetStation(v->current_order.station);
+ TileIndexDiffC center = {st->trainst_w/2, st->trainst_h/2};
fstd->station_index = v->current_order.station;
/* Let's take the center of the station as our target tile for trains */
- Station* st = GetStation(v->current_order.station);
- TileIndexDiffC center = {st->trainst_w/2, st->trainst_h/2};
fstd->dest_coords = TILE_ADD(st->train_tile, ToTileIndexDiff(center));
} else {
fstd->dest_coords = v->dest_tile;
diff --git a/ttd.dsp b/ttd.dsp
index 3f4a8b5db..b4151cddb 100644
--- a/ttd.dsp
+++ b/ttd.dsp
@@ -265,6 +265,10 @@ SOURCE=.\newgrf.c
# End Source File
# Begin Source File
+SOURCE=.\npf.c
+# End Source File
+
+# Begin Source File
SOURCE=.\oldloader.c
# End Source File
@@ -502,6 +506,10 @@ SOURCE=.\news.h
# End Source File
# Begin Source File
+SOURCE=.\npf.h
+# End Source File
+
+# Begin Source File
SOURCE=.\pathfind.h
# End Source File
diff --git a/ttd.vcproj b/ttd.vcproj
index 0718b90df..04cfaf0b7 100644
--- a/ttd.vcproj
+++ b/ttd.vcproj
@@ -601,6 +601,9 @@
RelativePath=".\newgrf.c">
</File>
<File
+ RelativePath=".\npf.c">
+ </File>
+ <File
RelativePath="oldloader.c">
<FileConfiguration
Name="Release|Win32">
@@ -1212,6 +1215,9 @@
RelativePath="news.h">
</File>
<File
+ RelativePath=".\npf.h">
+ </File>
+ <File
RelativePath="pathfind.h">
</File>
<File