18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 10:24:58 +01:00

feat(physicslog): the logs of the trains only, physicslog.trains

"physicslog.trains yes" in eu07.ini writes the .dat log of each driver who
drives rail vehicles, not of the passengers nor of the road vehicles that make
"physicslog yes" hundreds of files on a big scenery: the tape of every train.
A driver made primary later begins its log then, and isn't counted while it
doesn't log. The black box goes with it when the ini says nothing of its own,
and doesn't write a second log of a driver writing its own. The doc tells the
doors' sides are the vehicle's, the driver's swapped in the rear cab.
This commit is contained in:
maj00r
2026-11-15 23:48:23 +01:00
parent 043b9fb2f0
commit b7950af6b6
5 changed files with 54 additions and 14 deletions

View File

@@ -236,7 +236,7 @@ void blackbox_recorder::update(double const Deltatime) {
return;
m_started = true;
// "blackbox yes" or "no" of eu07.ini decides by itself, with no entry it goes with the physics logs
if (false == Global.BlackBox.value_or(WriteLogFlag) || Global.editor_session)
if (false == Global.BlackBox.value_or(WriteLogFlag || WriteTrainLogFlag) || Global.editor_session)
return;
open();
}
@@ -503,6 +503,9 @@ void blackbox_recorder::keep_tape_line() {
auto const *driver{vehicle->Mechanik != nullptr && vehicle->Mechanik->primary() ? vehicle->Mechanik : vehicle->ctOwner};
if (driver == nullptr)
return;
// a driver writing its own, of a train with "physicslog.trains yes", isn't written twice
if (driver->writes_physicslog())
return;
auto const &name{driver->physicslog_name()};
if (m_tapes.insert(name).second) {
PhysicsLogs.begin(name, TController::physicslog_header());