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

fix: keep the odometers of the vehicles with a driver's cab only

every vehicle which ran got a line in the store, the wagons of the AI's trains in every scenario too. the store
records a vehicle with a driver's brake valve (BrakeHandle in the .fiz), which can show its odometer; the locomotives
and units the AI runs before a player's cab loads them still get in with their replaceable made up states. the
states already in the file stay as they are
This commit is contained in:
jerrrrycho
2026-11-09 16:12:13 +01:00
parent 729f15e878
commit acf0716a9c
5 changed files with 73 additions and 2 deletions

View File

@@ -158,6 +158,12 @@ void store::record(std::string const &Vehicle, reading const &Odometer) {
m_modified = true;
}
void record(store &States, std::string const &Vehicle, bool const Drivercab, reading const &Odometer) {
if (false == Drivercab)
return;
States.record(Vehicle, Odometer);
}
void store::merge(store const &Other) {
for (auto const &[name, other] : Other.m_states) {
auto const [lookup, added] {m_states.try_emplace(name, other)};