diff --git a/dataobj/settings.cc b/dataobj/settings.cc index b05f4569d1..12abe392e5 100644 --- a/dataobj/settings.cc +++ b/dataobj/settings.cc @@ -301,6 +301,8 @@ settings_t::settings_t() : frames_per_second = 20; frames_per_step = 4; server_frames_ahead = 4; + + stop_halt_as_scheduled = true; } @@ -918,6 +920,10 @@ void settings_t::rdwr(loadsave_t *file) case 3: wind_direction = ribi_t::south; break; } } + + if( file->is_version_atleast(122, 2) ) { + file->rdwr_bool(stop_halt_as_scheduled); + } // otherwise the default values of the last one will be used } // sometimes broken savegames could have no legal direction for take off ... @@ -1584,6 +1590,8 @@ void settings_t::parse_simuconf( tabfile_t& simuconf, sint16& disp_width, sint16 world_maximum_height = contents.get_int_clamped("world_maximum_height", world_maximum_height, 16, 127); world_minimum_height = contents.get_int_clamped("world_minimum_height", world_minimum_height, -127, -12); + stop_halt_as_scheduled = contents.get_int("stop_halt_as_scheduled", stop_halt_as_scheduled); + // Default pak file path objfilename = ltrim(contents.get_string("pak_file_path", objfilename.c_str() ) ); diff --git a/dataobj/settings.h b/dataobj/settings.h index 9327f2bdeb..eca49d0bd9 100644 --- a/dataobj/settings.h +++ b/dataobj/settings.h @@ -314,6 +314,9 @@ class settings_t // true if companies can make ways public bool disable_make_way_public; + // only for trains. If true, trains stop at the position designated in the schdule.. + bool stop_halt_as_scheduled; + public: /* the big cost section */ sint32 maint_building; // normal building @@ -658,6 +661,9 @@ class settings_t bool get_departures_on_time() const { return departures_on_time; } void set_departures_on_time(bool b) { departures_on_time = b; } + + bool get_stop_halt_as_scheduled() const { return stop_halt_as_scheduled; } + void set_stop_halt_as_scheduled(bool b) { stop_halt_as_scheduled = b; } }; #endif diff --git a/gui/settings_stats.cc b/gui/settings_stats.cc index bf86403ee2..b3b0a849f8 100644 --- a/gui/settings_stats.cc +++ b/gui/settings_stats.cc @@ -236,6 +236,8 @@ void settings_routing_stats_t::init(settings_t const* const sets) INIT_NUM( "way_tunnel", sets->way_count_tunnel, 1, 1000, gui_numberinput_t::AUTOLINEAR, false ); INIT_NUM( "way_max_bridge_len", sets->way_max_bridge_len, 1, 1000, gui_numberinput_t::AUTOLINEAR, false ); INIT_NUM( "way_leaving_road", sets->way_count_leaving_road, 1, 1000, gui_numberinput_t::AUTOLINEAR, false ); + SEPERATOR + INIT_BOOL( "stop_halt_as_scheduled", sets->get_stop_halt_as_scheduled() ); INIT_END } @@ -262,6 +264,8 @@ void settings_routing_stats_t::read(settings_t* const sets) READ_NUM_VALUE( sets->way_count_tunnel ); READ_NUM_VALUE( sets->way_max_bridge_len ); READ_NUM_VALUE( sets->way_count_leaving_road ); + + READ_BOOL_VALUE( sets->stop_halt_as_scheduled ); } diff --git a/vehicle/rail_vehicle.cc b/vehicle/rail_vehicle.cc index 2e2e535a97..5555ad57f2 100644 --- a/vehicle/rail_vehicle.cc +++ b/vehicle/rail_vehicle.cc @@ -140,7 +140,8 @@ bool rail_vehicle_t::calc_route(koord3d start, koord3d ziel, sint32 max_speed, r cnv->set_next_reservation_index( 0 ); // nothing to reserve target_halt = halthandle_t(); // no block reserved // use length 8888 tiles to advance to the end of all stations - return route->calc_route(welt, start, ziel, this, max_speed, 8888 /*cnv->get_tile_length()*/ ); + const uint16 convoy_length = world()->get_settings().get_stop_halt_as_scheduled() ? cnv->get_tile_length() : 8888; + return route->calc_route(welt, start, ziel, this, max_speed, convoy_length ); }