18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-19 08:46:00 +01:00

feat: lock field shunting at zero and on resistive positions

New optional Cntrl. key ScndCtrlResistiveLock=Yes: IncScndCtrl() refuses
to step the shunt controller up while the master controller is at its
no-power position or on a resistive RList position (R >= 0.01), as the
interlock of the ET21, ET22 and EP09 does. Decreasing the shunt stays
allowed so it can't get stuck. The AI doesn't choose field shunting
while the lock applies. Without the key nothing changes.

Game data: the key is to be added to the Cntrl. line of the ET21
(et21_v2), ET22 (et22_v3, et22-2000_v2) and EP09 (ep09_v1, ep09_v2)
.fiz files that define it; until then they behave as before.

(eu07/maszyna#402)
This commit is contained in:
jerrrrycho
2026-11-07 21:01:54 +01:00
parent 939e42b611
commit 5bc4e7cd2e
4 changed files with 92 additions and 2 deletions

View File

@@ -3364,7 +3364,7 @@ bool TController::IncSpeed()
mvOccupied->Vel <= (IsCargoTrain ? 40 : 30) + (seriesmodefieldshunting ? 5 : 0) - (fAccGravity < -0.025 ? 10 : 0));
// when not in series mode use the first available parallel mode configuration until 50/60 km/h for passenger/cargo train
// (if there's only one parallel mode configuration it'll be used regardless of current speed)
auto const usefieldshunting = mvControlling->StLinFlag && mvControlling->RList[mvControlling->MainCtrlPos].R < 0.01 &&
auto const usefieldshunting = mvControlling->StLinFlag && mvControlling->RList[mvControlling->MainCtrlPos].R < 0.01 && false == mvControlling->IsScndCtrlLockedByMainCtrl() &&
(useseriesmode ? mvControlling->RList[mvControlling->MainCtrlPos].Bn == 1 :
true == sufficientacceleration && true == sufficienttractionforce && mvOccupied->Vel <= (IsCargoTrain ? 60 : 50) + (parallelmodefieldshunting ? 5 : 0) ?
mvControlling->RList[mvControlling->MainCtrlPos].Bn > 1 :