diff -r 68a692eacf22 -r 67db0d431d5e src/ship_cmd.cpp --- a/src/ship_cmd.cpp Mon May 26 20:45:25 2008 +0000 +++ b/src/ship_cmd.cpp Tue May 27 00:50:55 2008 +0000 @@ -106,7 +106,7 @@ static const Depot* FindClosestShipDepot(const Vehicle* v) { - if (_patches.pathfinder_for_ships == VPF_NPF) { /* NPF is used */ + if (_settings.pf.pathfinder_for_ships == VPF_NPF) { /* NPF is used */ Trackdir trackdir = GetVehicleTrackdir(v); NPFFoundTargetData ftd = NPFRouteToDepotTrialError(v->tile, trackdir, false, TRANSPORT_WATER, 0, v->owner, INVALID_RAILTYPES); @@ -137,7 +137,7 @@ static void CheckIfShipNeedsService(Vehicle *v) { - if (_patches.servint_ships == 0 || !v->NeedsAutomaticServicing()) return; + if (_settings.vehicle.servint_ships == 0 || !v->NeedsAutomaticServicing()) return; if (v->IsInDepot()) { VehicleServiceInDepot(v); return; @@ -196,7 +196,7 @@ InvalidateWindow(WC_VEHICLE_DETAILS, v->index); if (!PlayVehicleSound(v, VSE_BREAKDOWN)) { - SndPlayVehicleFx((_opt.landscape != LT_TOYLAND) ? + SndPlayVehicleFx((_settings.game_creation.landscape != LT_TOYLAND) ? SND_10_TRAIN_BREAKDOWN : SND_3A_COMEDY_BREAKDOWN_2, v); } @@ -320,7 +320,7 @@ /*updates statusbar only if speed have changed to save CPU time */ if (spd != v->cur_speed) { v->cur_speed = spd; - if (_patches.vehicle_speed) + if (_settings.gui.vehicle_speed) InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); } @@ -459,7 +459,7 @@ { assert(IsValidDiagDirection(enterdir)); - switch (_patches.pathfinder_for_ships) { + switch (_settings.pf.pathfinder_for_ships) { case VPF_YAPF: { /* YAPF */ Trackdir trackdir = YapfChooseShipTrack(v, tile, enterdir, tracks); if (trackdir != INVALID_TRACKDIR) return TrackdirToTrack(trackdir); @@ -756,7 +756,7 @@ unit_num = HasBit(p2, 0) ? 0 : GetFreeUnitNumber(VEH_SHIP); - if (!Vehicle::AllocateList(NULL, 1) || unit_num > _patches.max_ships) + if (!Vehicle::AllocateList(NULL, 1) || unit_num > _settings.vehicle.max_ships) return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME); if (flags & DC_EXEC) { @@ -800,7 +800,7 @@ v->name = NULL; v->u.ship.state = TRACK_BIT_DEPOT; - v->service_interval = _patches.servint_ships; + v->service_interval = _settings.vehicle.servint_ships; v->date_of_last_service = _date; v->build_year = _cur_year; v->cur_image = 0x0E5E; @@ -814,7 +814,7 @@ VehiclePositionChanged(v); InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); - RebuildVehicleLists(); + InvalidateWindowClassesData(WC_SHIPS_LIST, 0); InvalidateWindow(WC_COMPANY, v->owner); if (IsLocalPlayer()) InvalidateAutoreplaceWindow(v->engine_type, v->group_id); // updates the replace Ship window @@ -851,7 +851,7 @@ if (flags & DC_EXEC) { InvalidateWindow(WC_VEHICLE_DEPOT, v->tile); - RebuildVehicleLists(); + InvalidateWindowClassesData(WC_SHIPS_LIST, 0); InvalidateWindow(WC_COMPANY, v->owner); DeleteWindowById(WC_VEHICLE_VIEW, v->index); DeleteDepotHighlightOfVehicle(v); @@ -997,7 +997,7 @@ v->cargo_subtype = new_subtype; InvalidateWindow(WC_VEHICLE_DETAILS, v->index); InvalidateWindow(WC_VEHICLE_DEPOT, v->tile); - RebuildVehicleLists(); + InvalidateWindowClassesData(WC_SHIPS_LIST, 0); } return cost;