16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 02:09:17 +02:00

ai departure logic tweak, minor bug fixes

This commit is contained in:
tmj-fstate
2019-11-07 00:30:00 +01:00
parent a74402804d
commit 71098a7254
5 changed files with 27 additions and 19 deletions

View File

@@ -50,6 +50,13 @@ bool TTrainParameters::IsStop() const
return true; // na ostatnim się zatrzymać zawsze
}
bool TTrainParameters::IsMaintenance() const {
if( ( StationIndex < StationCount ) )
return TimeTable[ StationIndex ].is_maintenance;
else
return false;
}
bool TTrainParameters::UpdateMTable( scenario_time const &Time, std::string const &NewName ) {
return UpdateMTable( Time.data().wHour, Time.data().wMinute + Time.data().wSecond * 0.0167, NewName );
@@ -399,6 +406,7 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|| ( s == "2" )
|| fin.bad() ) ) {
record->StationWare += s;
record->is_maintenance = ( s.find( "pt" ) != std::string::npos );
fin >> s;
}
record->TrackNo = atoi(s.c_str());