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

Тиристор 81-717

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

View File

@@ -1130,7 +1130,7 @@ function TRAIN_SYSTEM:SolveThyristorController(Train, dT)
self.ThyristorState = 0.92 self.ThyristorState = 0.92
if I > 162 then--I > T * 0.9 then if I > 162 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))