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:
@@ -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)};
|
||||
|
||||
Reference in New Issue
Block a user