summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/order_gui.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 81350deb7..e50247e27 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -395,11 +395,13 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
if (st->owner == _local_company || st->owner == OWNER_NONE) {
byte facil;
- (facil = FACIL_DOCK, v->type == VEH_SHIP) ||
- (facil = FACIL_TRAIN, v->type == VEH_TRAIN) ||
- (facil = FACIL_AIRPORT, v->type == VEH_AIRCRAFT) ||
- (facil = FACIL_BUS_STOP, v->type == VEH_ROAD && RoadVehicle::From(v)->IsBus()) ||
- (facil = FACIL_TRUCK_STOP, 1);
+ switch (v->type) {
+ case VEH_SHIP: facil = FACIL_DOCK; break;
+ case VEH_TRAIN: facil = FACIL_TRAIN; break;
+ case VEH_AIRCRAFT: facil = FACIL_AIRPORT; break;
+ case VEH_ROAD: facil = RoadVehicle::From(v)->IsBus() ? FACIL_BUS_STOP : FACIL_TRUCK_STOP; break;
+ default: NOT_REACHED();
+ }
if (st->facilities & facil) {
order.MakeGoToStation(st_index);
if (_ctrl_pressed) order.SetLoadType(OLF_FULL_LOAD_ANY);