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

Тиристор 81-710

Исправлен расчет корня из отрицательного числа
This commit is contained in:
kosmik641
2025-10-08 03:30:22 +03:00
parent 5768f6af6a
commit a28a0da0a7

View File

@@ -527,7 +527,7 @@ function TRAIN_SYSTEM:SolveThyristorController(Train, dT,iter)
self.ThyristorState = 0.92 self.ThyristorState = 0.92
if I > 130 then--I > T * 0.9 then if I > 130 then--I > T * 0.9 then
self.PrepareElectric = false 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 end
else else
self.ThyristorState = math.max(0, math.min(1, self.ThyristorState + dC / rnd * dT)) self.ThyristorState = math.max(0, math.min(1, self.ThyristorState + dC / rnd * dT))