mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 13:54:58 +01:00
fix: AI wagon inspector sets G/P/R by the instruction Cw-1 (eu07/maszyna#350)
The brake settings the AI chooses for a train (TController::AutoRewident) now
follow Cw-1 (Mw56) §18 and §19:
- freight trains: the 500 m / 1300 t and 300 m / 600 t limits apply to the
wagons without the locomotives, limits included;
- long locomotive setting: the five wagons on G are counted from the head of
the train, not again after every locomotive in it;
- a vehicle without the setting the train needs gets the other of G and P;
- passenger trains run on R only with at most three cars on P, fewer than
those on R; cars with a magnetic rail brake run on R+Mg.
The choice moves to vehicle/brakesetting.{h,cpp} in eu07_core, with unit
tests. The old inspector stays behind the new eu07.ini key
ai.brakesetting.cw1 (default yes; no restores the earlier behaviour).
No game data changes needed.
(eu07/maszyna#350)
This commit is contained in:
@@ -699,6 +699,12 @@ bool global_settings::ConfigParseSimulation(cParser& Parser, const std::string&
|
||||
return true;
|
||||
}
|
||||
|
||||
if (token == "ai.brakesetting.cw1")
|
||||
{
|
||||
ParseOne(Parser, AIBrakeSettingCw1, 1, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (token == "pause")
|
||||
{
|
||||
std::string value;
|
||||
@@ -1590,6 +1596,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
|
||||
export_as_text( Output, "scenario.time.current", ScenarioTimeCurrent );
|
||||
export_as_text( Output, "scenario.weather.temperature", AirTemperature );
|
||||
export_as_text( Output, "ai.trainman", AITrainman );
|
||||
export_as_text( Output, "ai.brakesetting.cw1", AIBrakeSettingCw1 );
|
||||
export_as_text( Output, "scalespeculars", ScaleSpecularValues );
|
||||
export_as_text( Output, "gfxrenderer", GfxRenderer );
|
||||
export_as_text( Output, "shadows", RenderShadows );
|
||||
|
||||
Reference in New Issue
Block a user