diff --git a/src/order_gui.cpp b/src/order_gui.cpp --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -395,11 +395,13 @@ static Order GetOrderCmdFromTile(const V 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);