summaryrefslogtreecommitdiff
path: root/src/vehicle_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-22 20:17:07 +0000
committerrubidium <rubidium@openttd.org>2009-07-22 20:17:07 +0000
commit2962d8f0fc12699e2e952128c8f85b297c79e6b8 (patch)
tree05e8598bbad6f942ed1dd9a98823ea79cf41f175 /src/vehicle_cmd.cpp
parentc17c31b5b69d982f11859772fc4f2c9acef41555 (diff)
downloadopenttd-2962d8f0fc12699e2e952128c8f85b297c79e6b8.tar.xz
(svn r16920) -Codechange: shuffle some strings around to simplify looking up vehicle type specific strings for a specific message
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r--src/vehicle_cmd.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index 36805b8d3..6bc2fde7a 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -93,27 +93,13 @@ CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1,
}
if (flags & DC_EXEC) {
- static const StringID vehicle_waiting_in_depot[] = {
- STR_NEWS_TRAIN_IS_WAITING,
- STR_NEWS_ROAD_VEHICLE_IS_WAITING,
- STR_NEWS_SHIP_IS_WAITING,
- STR_NEWS_AIRCRAFT_IS_WAITING,
- };
-
- static const WindowClass vehicle_list[] = {
- WC_TRAINS_LIST,
- WC_ROADVEH_LIST,
- WC_SHIPS_LIST,
- WC_AIRCRAFT_LIST,
- };
-
- if (v->IsStoppedInDepot() && (flags & DC_AUTOREPLACE) == 0) DeleteVehicleNews(p1, vehicle_waiting_in_depot[v->type]);
+ if (v->IsStoppedInDepot() && (flags & DC_AUTOREPLACE) == 0) DeleteVehicleNews(p1, STR_NEWS_TRAIN_IS_WAITING + v->type);
v->vehstatus ^= VS_STOPPED;
if (v->type != VEH_TRAIN) v->cur_speed = 0; // trains can stop 'slowly'
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
- InvalidateWindowClasses(vehicle_list[v->type]);
+ InvalidateWindowClasses(GetWindowClassForVehicleType(v->type));
}
return CommandCost();
}