summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-02-04 15:13:20 +0000
committerrubidium <rubidium@openttd.org>2011-02-04 15:13:20 +0000
commit4c5ca174861c4324761b31de5a98a5c9a7d976df (patch)
tree83c8b371d885f2ee61a178e570bcec9474f0a225 /src
parent71f4067d19b4d861b93bd5f6fe290d9d95eec4fd (diff)
downloadopenttd-4c5ca174861c4324761b31de5a98a5c9a7d976df.tar.xz
(svn r21957) -Cleanup: gotodepot and timetabling settings are more or less useless; just don't use depot orders or timetabling if you don't want to use it
Diffstat (limited to 'src')
-rw-r--r--src/economy.cpp2
-rw-r--r--src/lang/english.txt2
-rw-r--r--src/order_gui.cpp72
-rw-r--r--src/settings_gui.cpp4
-rw-r--r--src/settings_type.h2
-rw-r--r--src/table/settings.h4
-rw-r--r--src/timetable_cmd.cpp9
-rw-r--r--src/vehicle.cpp5
8 files changed, 38 insertions, 62 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index af93834e7..a5f338825 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1334,7 +1334,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
/* We loaded less cargo than possible for all cargo types and it's not full
* load and we're not supposed to wait any longer: stop loading. */
if (!anything_unloaded && full_load_amount == 0 && !(v->current_order.GetLoadType() & OLFB_FULL_LOAD) &&
- (!_settings_game.order.timetabling || v->current_order_time >= (uint)max(v->current_order.wait_time - v->lateness_counter, 0))) {
+ v->current_order_time >= (uint)max(v->current_order.wait_time - v->lateness_counter, 0)) {
SetBit(v->vehicle_flags, VF_STOP_LOADING);
}
} else {
diff --git a/src/lang/english.txt b/src/lang/english.txt
index e2671b942..cc2d8d76a 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1115,7 +1115,6 @@ STR_CONFIG_SETTING_GRADUAL_LOADING :{LTBLUE}Load ve
STR_CONFIG_SETTING_INFLATION :{LTBLUE}Inflation: {ORANGE}{STRING1}
STR_CONFIG_SETTING_SELECTGOODS :{LTBLUE}Deliver cargo to a station only when there is a demand: {ORANGE}{STRING1}
STR_CONFIG_SETTING_LONGBRIDGES :{LTBLUE}Allow building very long bridges: {ORANGE}{STRING1}
-STR_CONFIG_SETTING_GOTODEPOT :{LTBLUE}Allow goto depot orders: {ORANGE}{STRING1}
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD :{LTBLUE}Manual primary industry construction method: {ORANGE}{STRING1}
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE :none
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL :as other industries
@@ -1232,7 +1231,6 @@ STR_CONFIG_SETTING_LOADING_INDICATORS :{LTBLUE}Use loa
STR_CONFIG_SETTING_LOADING_INDICATORS_OFF :Off
STR_CONFIG_SETTING_LOADING_INDICATORS_OWN :Own company
STR_CONFIG_SETTING_LOADING_INDICATORS_ALL :All companies
-STR_CONFIG_SETTING_TIMETABLE_ALLOW :{LTBLUE}Enable timetabling for vehicles: {ORANGE}{STRING1}
STR_CONFIG_SETTING_TIMETABLE_IN_TICKS :{LTBLUE}Show timetable in ticks rather than days: {ORANGE}{STRING1}
STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :{LTBLUE}Show arrival and departure in timetables: {ORANGE}{STRING1}
STR_CONFIG_SETTING_QUICKGOTO :{LTBLUE}Quick creation of vehicle orders: {ORANGE}{STRING1}
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index d98140432..e5b49fadf 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -325,49 +325,47 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
order.index = 0;
/* check depot first */
- if (_settings_game.order.gotodepot) {
- switch (GetTileType(tile)) {
- case MP_RAILWAY:
- if (v->type == VEH_TRAIN && IsTileOwner(tile, _local_company)) {
- if (IsRailDepot(tile)) {
- order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS,
- _settings_client.gui.new_nonstop ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE);
- if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
- return order;
- }
- }
- break;
-
- case MP_ROAD:
- if (IsRoadDepot(tile) && v->type == VEH_ROAD && IsTileOwner(tile, _local_company)) {
+ switch (GetTileType(tile)) {
+ case MP_RAILWAY:
+ if (v->type == VEH_TRAIN && IsTileOwner(tile, _local_company)) {
+ if (IsRailDepot(tile)) {
order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS,
_settings_client.gui.new_nonstop ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE);
if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
return order;
}
- break;
+ }
+ break;
- case MP_STATION:
- if (v->type != VEH_AIRCRAFT) break;
- if (IsHangar(tile) && IsTileOwner(tile, _local_company)) {
- order.MakeGoToDepot(GetStationIndex(tile), ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE);
- if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
- return order;
- }
- break;
+ case MP_ROAD:
+ if (IsRoadDepot(tile) && v->type == VEH_ROAD && IsTileOwner(tile, _local_company)) {
+ order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS,
+ _settings_client.gui.new_nonstop ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE);
+ if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
+ return order;
+ }
+ break;
- case MP_WATER:
- if (v->type != VEH_SHIP) break;
- if (IsShipDepot(tile) && IsTileOwner(tile, _local_company)) {
- order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE);
- if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
- return order;
- }
- break;
+ case MP_STATION:
+ if (v->type != VEH_AIRCRAFT) break;
+ if (IsHangar(tile) && IsTileOwner(tile, _local_company)) {
+ order.MakeGoToDepot(GetStationIndex(tile), ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE);
+ if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
+ return order;
+ }
+ break;
- default:
- break;
- }
+ case MP_WATER:
+ if (v->type != VEH_SHIP) break;
+ if (IsShipDepot(tile) && IsTileOwner(tile, _local_company)) {
+ order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE);
+ if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
+ return order;
+ }
+ break;
+
+ default:
+ break;
}
/* check waypoint */
@@ -778,10 +776,6 @@ public:
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
{
switch (widget) {
- case ORDER_WIDGET_TIMETABLE_VIEW:
- if (!_settings_game.order.timetabling) size->width = 0;
- break;
-
case ORDER_WIDGET_ORDER_LIST:
resize->height = FONT_HEIGHT_NORMAL;
size->height = 6 * resize->height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 6f1880d7f..15f285715 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1263,8 +1263,6 @@ uint SettingsPage::Draw(GameSettings *settings_ptr, int left, int right, int bas
static SettingEntry _settings_ui_display[] = {
- SettingEntry("gui.vehicle_speed"),
- SettingEntry("gui.status_long_date"),
SettingEntry("gui.date_format_in_default_names"),
SettingEntry("gui.population_in_label"),
SettingEntry("gui.measure_tooltip"),
@@ -1467,7 +1465,6 @@ static SettingEntry _settings_vehicles[] = {
SettingEntry(&_settings_vehicles_autorenew_page, STR_CONFIG_SETTING_VEHICLES_AUTORENEW),
SettingEntry(&_settings_vehicles_servicing_page, STR_CONFIG_SETTING_VEHICLES_SERVICING),
SettingEntry(&_settings_vehicles_trains_page, STR_CONFIG_SETTING_VEHICLES_TRAINS),
- SettingEntry("order.gotodepot"),
SettingEntry("gui.new_nonstop"),
SettingEntry("gui.order_review_system"),
SettingEntry("gui.vehicle_income_warn"),
@@ -1479,7 +1476,6 @@ static SettingEntry _settings_vehicles[] = {
SettingEntry("vehicle.max_ships"),
SettingEntry("vehicle.plane_speed"),
SettingEntry("vehicle.plane_crashes"),
- SettingEntry("order.timetabling"),
SettingEntry("vehicle.dynamic_engines"),
SettingEntry("vehicle.roadveh_acceleration_model"),
SettingEntry("vehicle.roadveh_slope_steepness"),
diff --git a/src/settings_type.h b/src/settings_type.h
index 3fe5690b3..450a8849f 100644
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -329,9 +329,7 @@ struct OrderSettings {
bool improved_load; ///< improved loading algorithm
bool gradual_loading; ///< load vehicles gradually
bool selectgoods; ///< only send the goods to station if a train has been there
- bool gotodepot; ///< allow goto depot in orders
bool no_servicing_if_no_breakdowns; ///< dont send vehicles to depot when breakdowns are disabled
- bool timetabling; ///< whether to allow timetabling
bool serviceathelipad; ///< service helicopters at helipads automatically (no need to send to depot)
};
diff --git a/src/table/settings.h b/src/table/settings.h
index f10fcbe19..7d0e4d461 100644
--- a/src/table/settings.h
+++ b/src/table/settings.h
@@ -393,7 +393,7 @@ const SettingDesc _settings[] = {
SDT_BOOL(GameSettings, pf.forbid_90_deg, 0, 0, false, STR_CONFIG_SETTING_FORBID_90_DEG, NULL),
SDT_BOOL(GameSettings, vehicle.mammoth_trains, 0,NN, true, STR_CONFIG_SETTING_MAMMOTHTRAINS, NULL),
SDT_CONDVAR(GameSettings, vehicle.smoke_amount, SLE_UINT8,145, SL_MAX_VERSION, 0,MS, 1, 0, 2, 0, STR_CONFIG_SETTING_SMOKE_AMOUNT, NULL),
- SDT_BOOL(GameSettings, order.gotodepot, 0, 0, true, STR_CONFIG_SETTING_GOTODEPOT, NULL),
+ SDT_CONDNULL( 1, 0, 158), // order.gotodepot
SDT_BOOL(GameSettings, pf.roadveh_queue, 0, 0, true, STR_CONFIG_SETTING_ROAD_VEHICLE_QUEUEING, NULL),
SDT_CONDBOOL(GameSettings, pf.new_pathfinding_all, 0, 86, 0, 0, false, STR_NULL, NULL),
@@ -419,7 +419,7 @@ const SettingDesc _settings[] = {
SDT_BOOL(GameSettings, vehicle.wagon_speed_limits, 0,NN, true, STR_CONFIG_SETTING_WAGONSPEEDLIMITS, UpdateConsists),
SDT_CONDBOOL(GameSettings, vehicle.disable_elrails, 38, SL_MAX_VERSION, 0,NN, false, STR_CONFIG_SETTING_DISABLE_ELRAILS, SettingsDisableElrail),
SDT_CONDVAR(GameSettings, vehicle.freight_trains, SLE_UINT8, 39, SL_MAX_VERSION, 0,NN, 1, 1, 255, 1, STR_CONFIG_SETTING_FREIGHT_TRAINS, NULL),
- SDT_CONDBOOL(GameSettings, order.timetabling, 67, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_SETTING_TIMETABLE_ALLOW, NULL),
+ SDT_CONDNULL( 1, 67, 158), // order.timetabling
SDT_CONDVAR(GameSettings, vehicle.plane_speed, SLE_UINT8, 90, SL_MAX_VERSION, 0,NN, 4, 1, 4, 0, STR_CONFIG_SETTING_PLANE_SPEED, NULL),
SDT_CONDBOOL(GameSettings, vehicle.dynamic_engines, 95, SL_MAX_VERSION, 0,NN, true, STR_CONFIG_SETTING_DYNAMIC_ENGINES, ChangeDynamicEngines),
SDT_CONDVAR(GameSettings, vehicle.plane_crashes, SLE_UINT8,138, SL_MAX_VERSION, 0,MS, 2, 0, 2, 1, STR_CONFIG_SETTING_PLANE_CRASHES, NULL),
diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp
index 688a5d15e..fbb1ebe24 100644
--- a/src/timetable_cmd.cpp
+++ b/src/timetable_cmd.cpp
@@ -60,8 +60,6 @@ static void ChangeTimetable(Vehicle *v, VehicleOrderID order_number, uint16 time
*/
CommandCost CmdChangeTimetable(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
- if (!_settings_game.order.timetabling) return CMD_ERROR;
-
VehicleID veh = GB(p1, 0, 20);
Vehicle *v = Vehicle::GetIfValid(veh);
@@ -119,8 +117,6 @@ CommandCost CmdChangeTimetable(TileIndex tile, DoCommandFlag flags, uint32 p1, u
*/
CommandCost CmdSetVehicleOnTime(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
- if (!_settings_game.order.timetabling) return CMD_ERROR;
-
VehicleID veh = GB(p1, 0, 20);
Vehicle *v = Vehicle::GetIfValid(veh);
@@ -148,8 +144,6 @@ CommandCost CmdSetVehicleOnTime(TileIndex tile, DoCommandFlag flags, uint32 p1,
*/
CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
- if (!_settings_game.order.timetabling) return CMD_ERROR;
-
Vehicle *v = Vehicle::GetIfValid(GB(p1, 0, 20));
if (v == NULL || !v->IsPrimaryVehicle()) return CMD_ERROR;
@@ -189,8 +183,6 @@ CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1,
*/
CommandCost CmdAutofillTimetable(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
- if (!_settings_game.order.timetabling) return CMD_ERROR;
-
VehicleID veh = GB(p1, 0, 20);
Vehicle *v = Vehicle::GetIfValid(veh);
@@ -237,7 +229,6 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling)
v->current_order_time = 0;
- if (!_settings_game.order.timetabling) return;
if (v->current_order.IsType(OT_AUTOMATIC)) return; // no timetabling of auto orders
VehicleOrderID first_manual_order = 0;
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index ada4948ea..d04bc3eab 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -168,7 +168,7 @@ bool Vehicle::NeedsServicing() const
*/
bool Vehicle::NeedsAutomaticServicing() const
{
- if (_settings_game.order.gotodepot && this->HasDepotOrder()) return false;
+ if (this->HasDepotOrder()) return false;
if (this->current_order.IsType(OT_LOADING)) return false;
if (this->current_order.IsType(OT_GOTO_DEPOT) && this->current_order.GetDepotOrderType() != ODTFB_SERVICE) return false;
return NeedsServicing();
@@ -1912,8 +1912,7 @@ void Vehicle::HandleLoading(bool mode)
uint wait_time = max(this->current_order.wait_time - this->lateness_counter, 0);
/* Not the first call for this tick, or still loading */
- if (mode || !HasBit(this->vehicle_flags, VF_LOADING_FINISHED) ||
- (_settings_game.order.timetabling && this->current_order_time < wait_time)) return;
+ if (mode || !HasBit(this->vehicle_flags, VF_LOADING_FINISHED) || this->current_order_time < wait_time) return;
this->PlayLeaveStationSound();