(svn r16439) -Change: Make the default vehicle servicing settings company-based settings, so in a multiplayer game everyone can change them.

This commit is contained in:
yexo
2009-05-26 21:59:49 +00:00
parent aa62ec0a1f
commit 0d56cfabfa
17 changed files with 88 additions and 53 deletions

View File

@@ -858,7 +858,7 @@ CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1,
v->railtype = rvi->railtype;
_new_vehicle_id = v->index;
v->service_interval = _settings_game.vehicle.servint_trains;
v->service_interval = Company::Get(_current_company)->settings.vehicle.servint_trains;
v->date_of_last_service = _date;
v->build_year = _cur_year;
v->cur_image = SPR_IMG_QUERY;
@@ -4464,7 +4464,7 @@ static void CheckIfTrainNeedsService(Train *v)
{
static const uint MAX_ACCEPTABLE_DEPOT_DIST = 16;
if (_settings_game.vehicle.servint_trains == 0 || !v->NeedsAutomaticServicing()) return;
if (Company::Get(v->owner)->settings.vehicle.servint_trains == 0 || !v->NeedsAutomaticServicing()) return;
if (v->IsInDepot()) {
VehicleServiceInDepot(v);
return;