18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 18:47:06 +01:00

refactor(physics): the faults of the equipment are a named set the physics sets

The faults the scenery or the network sets on a vehicle (TDynamicObject::
Damage() with the number of a message, held as EngDmgFlag and tested as its
bits 1, 4) are EquipmentFault and EquipmentFaultSet, and what each does moves
out of TDynamicObject into physics::Vehicle::SetEquipmentFaults(). The number of
a message comes in through FromBits() and goes back out through Bits(), as it
was.

The faults of the control and of the camshaft still hold the start and the
steps of the controller by delays moved out of reach by 100000001 and back,
the very same arithmetic, now named and in one place. Tests of it are added
(test_equipment_faults.cpp), as nothing reached it before.

The setters of the parts that took a parameter named as one of their queries
(Pressure, Voltage) take Value instead.

No change in behaviour: the golden traces recorded on dfb43c4f match bit for bit.
This commit is contained in:
2026-11-29 10:56:17 +01:00
parent d28b908ca4
commit 6b9558f588
12 changed files with 140 additions and 76 deletions
+1 -1
View File
@@ -782,7 +782,7 @@ void physics::Vehicle::rerail()
void physics::Vehicle::repair_damage()
{
DamageFlag = {};
EngDmgFlag = 0;
equipmentFaults = {};
WheelFlat = 0.0;
brakes.alarmChain = false;
// the crushed ends rebuilt