summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-12-10 18:16:08 +0000
committertron <tron@openttd.org>2004-12-10 18:16:08 +0000
commit5b0915e67774c9e8ac84d192cf6bd409286166ec (patch)
tree66a06b77592865f6aa9640d6c1ddd3648d89f2d3 /train_cmd.c
parent55bac62c5ac9a404f970fdfc1eccde155dea641c (diff)
downloadopenttd-5b0915e67774c9e8ac84d192cf6bd409286166ec.tar.xz
(svn r1009) -Feature: per-station vehicle lists
This adds a little button per vehicle class to the station window which opens a list of all vehicles that have this station on their schedule. As side effect this gets rid of some global variables.
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 1b79001fc..256ccb6d5 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -499,8 +499,7 @@ int32 CmdBuildRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
NormalizeTrainVehInDepot(v);
InvalidateWindow(WC_VEHICLE_DEPOT, tile);
- _vehicle_sort_dirty[VEHTRAIN] = true; // build a trainengine
- InvalidateWindow(WC_TRAINS_LIST, v->owner);
+ RebuildVehicleLists();
InvalidateWindow(WC_COMPANY, v->owner);
}
}
@@ -811,8 +810,7 @@ int32 CmdSellRailWagon(int x, int y, uint32 flags, uint32 p1, uint32 p2)
// always redraw the depot. maybe redraw train list
InvalidateWindow(WC_VEHICLE_DEPOT, first->tile);
if (first->subtype == 0) {
- _vehicle_sort_dirty[VEHTRAIN] = true; // sell a wagon / locomotive
- InvalidateWindow(WC_TRAINS_LIST, first->owner);
+ RebuildVehicleLists();
}
// when selling an attached locomotive. we need to delete its window.
if (v->subtype == 0) {
@@ -2254,8 +2252,7 @@ static void DeleteLastWagon(Vehicle *v)
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
DeleteWindowById(WC_VEHICLE_VIEW, v->index);
- _vehicle_sort_dirty[VEHTRAIN] = true; // remove crashed train
- InvalidateWindow(WC_TRAINS_LIST, v->owner);
+ RebuildVehicleLists();
InvalidateWindow(WC_COMPANY, v->owner);
BeginVehicleMove(v);