1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

Merge pull request #603 from metrostroi-repo/thyristor717_fix

Фикс расчёта электрики 81-710, 81-717
This commit is contained in:
CrIcKeT98
2025-10-08 03:37:43 +03:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -527,7 +527,7 @@ function TRAIN_SYSTEM:SolveThyristorController(Train, dT,iter)
self.ThyristorState = 0.92
if I > 130 then--I > T * 0.9 then
self.PrepareElectric = false
self.ThyristorState = (1 - math.max(0, math.min(1, ((Train.Engines.Speed - 50) / 32)) ^ 0.5)) * 0.9
self.ThyristorState = (1 - math.max(0, math.min(1, (math.max(0, Train.Engines.Speed - 50) / 32)) ^ 0.5)) * 0.9
end
else
self.ThyristorState = math.max(0, math.min(1, self.ThyristorState + dC / rnd * dT))

View File

@@ -1130,7 +1130,7 @@ function TRAIN_SYSTEM:SolveThyristorController(Train, dT)
self.ThyristorState = 0.92
if I > 162 then--I > T * 0.9 then
self.PrepareElectric = false
self.ThyristorState = (1 - math.max(0, math.min(1, ((Train.Engines.Speed - 50) / 32)) ^ 0.5)) * 0.9
self.ThyristorState = (1 - math.max(0, math.min(1, (math.max(0, Train.Engines.Speed - 50) / 32)) ^ 0.5)) * 0.9
end
else
self.ThyristorState = math.max(0, math.min(1, self.ThyristorState + dC / rnd * dT))