18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 07:22:42 +01:00

refactor(physics): the lights, the load and the event flags are private to the vehicle

- The lights switched on at each end (iLights) are LitLights(), changed
  through SetLitLights(): the cab's switches, the AI's light patterns and the
  scenery's toggles of the end signals all go through it.
- The exchange of the load, which TDynamicObject ran by setting the status, the
  amount and the mass itself, goes through UnloadStep(), LoadStep(),
  FinishLoadExchange() and AcknowledgeLoadExchange(), with the same arithmetic;
  the change of the kind of the load is taken once (TakeLoadTypeChange()).
- The events the physics reports for the sounds to follow up are raised and
  cleared by name (RaiseEventFlag(), ClearEventFlag(), ClearSoundFlags()).

No change in behaviour: the golden traces recorded on dfb43c4f match bit for bit.
This commit is contained in:
2026-11-29 12:33:13 +01:00
parent 84f1aa2515
commit 242474dd11
34 changed files with 331 additions and 286 deletions
+3 -3
View File
@@ -147,18 +147,18 @@ bool physics::Vehicle::CheckLocomotiveParameters(bool ReadyFlag, int /*Dir*/)
if (brakes.loadSetting > 0)
{
if (LoadAmount < MaxLoad * 0.45)
if (loadAmount < maxLoad * 0.45)
{
IncBrakeMult();
IncBrakeMult();
DecBrakeMult(); // TODO: przeinesiono do physics.cpp
if (LoadAmount < MaxLoad * 0.35)
if (loadAmount < maxLoad * 0.35)
DecBrakeMult();
}
else
{
IncBrakeMult(); // TODO: przeinesiono do physics.cpp
if (LoadAmount >= MaxLoad * 0.55)
if (loadAmount >= maxLoad * 0.55)
IncBrakeMult();
}
}