diff options
author | rubidium <rubidium@openttd.org> | 2007-05-02 09:29:41 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-05-02 09:29:41 +0000 |
commit | dce7dcb6649dca7a05f5abc5b006822a05e06056 (patch) | |
tree | 978891d08beaf2b636b81a38b9c296680f5fdec6 /src/vehicle.cpp | |
parent | 1bea3b55a672185f8e65430af8ec86ff5eef3704 (diff) | |
download | openttd-dce7dcb6649dca7a05f5abc5b006822a05e06056.tar.xz |
(svn r9764) -Codechange: replace some lookup tables by functions.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 143f1fc36..20f67c771 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2970,13 +2970,9 @@ void Vehicle::BeginLoading() current_order.type = OT_LOADING; GetStation(this->last_station_visited)->loading_vehicles.push_back(this); - static const int expense_type[] = { EXPENSES_TRAIN_INC, EXPENSES_ROADVEH_INC, EXPENSES_SHIP_INC, EXPENSES_AIRCRAFT_INC }; - SET_EXPENSES_TYPE(expense_type[this->type]); - + SET_EXPENSES_TYPE(this->GetExpenseType(true)); if (LoadUnloadVehicle(this, true) != 0) { - static const WindowClass invalidate_windows[] = { WC_TRAINS_LIST, WC_ROADVEH_LIST, WC_SHIPS_LIST, WC_AIRCRAFT_LIST }; - InvalidateWindow(invalidate_windows[this->type], this->owner); - + InvalidateWindow(this->GetVehicleListWindowClass(), this->owner); this->MarkDirty(); } InvalidateWindowWidget(WC_VEHICLE_VIEW, this->index, STATUS_BAR); |