summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-25 19:17:03 +0000
committerrubidium <rubidium@openttd.org>2008-05-25 19:17:03 +0000
commit4625695653c3c0be16b61b640c206c557af9ec7b (patch)
treed480693e848eb121add7037faa150875d750cc98 /src/vehicle.cpp
parent6ea832ec7cbd572c72e96a179bb8c744834ee2e7 (diff)
downloadopenttd-4625695653c3c0be16b61b640c206c557af9ec7b.tar.xz
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
-Codechange: move all Settings into substructs of _settings in a way that they are logically grouped.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index e8793a126..bdfef2aa4 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -127,20 +127,20 @@ bool Vehicle::NeedsServicing() const
{
if (this->vehstatus & (VS_STOPPED | VS_CRASHED)) return false;
- if (_patches.no_servicing_if_no_breakdowns && _opt.diff.vehicle_breakdowns == 0) {
+ if (_settings.order.no_servicing_if_no_breakdowns && _opt.diff.vehicle_breakdowns == 0) {
/* Vehicles set for autoreplacing needs to go to a depot even if breakdowns are turned off.
* Note: If servicing is enabled, we postpone replacement till next service. */
return EngineHasReplacementForPlayer(GetPlayer(this->owner), this->engine_type, this->group_id);
}
- return _patches.servint_ispercent ?
+ return _settings.vehicle.servint_ispercent ?
(this->reliability < GetEngine(this->engine_type)->reliability * (100 - this->service_interval) / 100) :
(this->date_of_last_service + this->service_interval < _date);
}
bool Vehicle::NeedsAutomaticServicing() const
{
- if (_patches.gotodepot && VehicleHasDepotOrders(this)) return false;
+ if (_settings.order.gotodepot && VehicleHasDepotOrders(this)) 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();
@@ -1855,10 +1855,10 @@ UnitID GetFreeUnitNumber(VehicleType type)
static UnitID gmax = 0;
switch (type) {
- case VEH_TRAIN: max = _patches.max_trains; break;
- case VEH_ROAD: max = _patches.max_roadveh; break;
- case VEH_SHIP: max = _patches.max_ships; break;
- case VEH_AIRCRAFT: max = _patches.max_aircraft; break;
+ case VEH_TRAIN: max = _settings.vehicle.max_trains; break;
+ case VEH_ROAD: max = _settings.vehicle.max_roadveh; break;
+ case VEH_SHIP: max = _settings.vehicle.max_ships; break;
+ case VEH_AIRCRAFT: max = _settings.vehicle.max_aircraft; break;
default: NOT_REACHED();
}
@@ -1908,14 +1908,14 @@ bool CanBuildVehicleInfrastructure(VehicleType type)
assert(IsPlayerBuildableVehicleType(type));
if (!IsValidPlayer(_current_player)) return false;
- if (_patches.always_build_infrastructure) return true;
+ if (_settings.gui.always_build_infrastructure) return true;
UnitID max;
switch (type) {
- case VEH_TRAIN: max = _patches.max_trains; break;
- case VEH_ROAD: max = _patches.max_roadveh; break;
- case VEH_SHIP: max = _patches.max_ships; break;
- case VEH_AIRCRAFT: max = _patches.max_aircraft; break;
+ case VEH_TRAIN: max = _settings.vehicle.max_trains; break;
+ case VEH_ROAD: max = _settings.vehicle.max_roadveh; break;
+ case VEH_SHIP: max = _settings.vehicle.max_ships; break;
+ case VEH_AIRCRAFT: max = _settings.vehicle.max_aircraft; break;
default: NOT_REACHED();
}
@@ -1947,7 +1947,7 @@ const Livery *GetEngineLivery(EngineID engine_type, PlayerID player, EngineID pa
/* The default livery is always available for use, but its in_use flag determines
* whether any _other_ liveries are in use. */
- if (p->livery[LS_DEFAULT].in_use && (_patches.liveries == 2 || (_patches.liveries == 1 && player == _local_player))) {
+ if (p->livery[LS_DEFAULT].in_use && (_settings.gui.liveries == 2 || (_settings.gui.liveries == 1 && player == _local_player))) {
/* Determine the livery scheme to use */
switch (GetEngine(engine_type)->type) {
default: NOT_REACHED();
@@ -2514,7 +2514,7 @@ void Vehicle::HandleLoading(bool mode)
/* Not the first call for this tick, or still loading */
if (mode || !HasBit(this->vehicle_flags, VF_LOADING_FINISHED) ||
- (_patches.timetabling && this->current_order_time < wait_time)) return;
+ (_settings.order.timetabling && this->current_order_time < wait_time)) return;
this->PlayLeaveStationSound();