mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-27 21:45:16 +01:00
* fix: a switch of the field shunting of the diesel-electrics, and its cab control (GE#167)
The SU45 and SP45 shunt the field of their motors by relays (RelayType 45),
which the driver lets work with a toggle switch on the desk ("załączenie
bocznikowania"). The game had no such switch: AutoRelay=Yes shunts always,
and AutoRelay=Optional on a diesel-electric meant manual shunting with the
switch off. No cab control showed the switch either, so the lever of the
SU45's cab (zalaczbocznikow) had nothing to follow.
- AutoRelay=Optional on a diesel-electric: switched off, no shunting at all
(fieldshunting::diesel_electric() in the core library, used by
IncScndCtrl() and the shunting relays in TractionForce()). No
diesel-electric of the game data uses AutoRelay=Optional; AutoRelay=Yes
and No don't change.
- A new cab control, autorelay_sw:, showing AutoRelayFlag and toggling it
with notchingrelaytoggle on a click.
- The AI switches it on as it gets a diesel-electric ready.
Needs the game data (SVN) to take effect, after the release:
- dynamic/pkp/su45_v2/301d.fiz, sp45_v1/301db.fiz, 301db-152.fiz:
AutoRelay=Yes -> AutoRelay=Optional
- dynamic/pkp/su45_v2/301d.mmd, sp45_v1/301db.mmd, 301db-152.mmd,
301db_factory.mmd: add
autorelay_sw: { zalaczbocznikow rot 0.11 0 0.1 soundinc: 20786_203E_switch_converter_2_on.wav sounddec: 20786_203E_switch_converter_2_of.wav }
Without them the vehicles behave as before.
* refactor(mover): the field shunting switch without Sonar issues
The control is declared in the if that uses it, the relays' branch tests
AutoRelayFlag as before (the same condition as the automatic control, and
no deeper nesting on a changed line), using enum in diesel_electric(),
and the test no longer shadows the name control. No change in behaviour.
* fix(ai): the AI turns the field shunting switch on while running too
It did so only in PrepareEngine(), which isn't called again while the
engine runs, so a running SU45 handed to the AI with the switch off
stayed on full field.
* fix(mover): AutoRelay=Optional keeps its meaning, the field shunting switch is FieldShuntSwitch=Yes
AutoRelay=Optional means again what it did for every diesel-electric: with the
switch off, the driver shunts the field by hand with the second controller. The
switch that leaves the field full when off, as on the SU45 and SP45, is opted
into with a new Cntrl. key, FieldShuntSwitch=Yes, next to AutoRelay=Optional.
A key rather than a new AutoRelay value: the parser reads an AutoRelay value it
doesn't know as No, so an older exe would take the relays away from the SU45,
while it skips an unknown key. The value stays Optional, which every check of
the switch looks for.
The AI switches it on only in a vehicle with the key; one with AutoRelay=Optional
alone is left as before. The SVN data then needs "AutoRelay=Optional
FieldShuntSwitch=Yes" on line 9 of su45_v2/301d.fiz, sp45_v1/301db.fiz and
sp45_v1/301db-152.fiz, after this is released; without it nothing changes.