From 6c0f28037f7d6afc3ba839df9f18a219c0e57adb Mon Sep 17 00:00:00 2001 From: BlueSnooty <89611276+BlueSnooty@users.noreply.github.com> Date: Tue, 12 Jul 2022 00:44:15 +0300 Subject: [PATCH] Update sys_81_717_pneumatic.lua Check if Train.EPKC exists added --- lua/metrostroi/systems/sys_81_717_pneumatic.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/metrostroi/systems/sys_81_717_pneumatic.lua b/lua/metrostroi/systems/sys_81_717_pneumatic.lua index 689a11d..b60877a 100644 --- a/lua/metrostroi/systems/sys_81_717_pneumatic.lua +++ b/lua/metrostroi/systems/sys_81_717_pneumatic.lua @@ -400,12 +400,12 @@ function TRAIN_SYSTEM:Think(dT) local TLDisconnect = self.DisconnectType and Train.DriverValveTLDisconnect.Value > 0 or Train.DriverValveDisconnect.Value > 0 -- 013: 1 Overcharge if (self.RealDriverValvePosition == 1) and BLDisconnect and (TLDisconnect or self.BrakeLinePressure > self.TrainLinePressure) then - self:equalizePressure(dT,"BrakeLinePressure", math.min(6.4,self.TrainLinePressure), pr_speed,Train.EPKC.Value==0 and Train.EPK.Value > 0 and pr_speed*2.2 or pr_speed*0.35, nil, 1.0) + self:equalizePressure(dT,"BrakeLinePressure", math.min(6.4,self.TrainLinePressure), pr_speed,Train.EPKC and Train.EPKC.Value==0 and Train.EPK.Value > 0 and pr_speed*2.2 or pr_speed*0.35, nil, 1.0) end -- 013: 2 Normal pressure if (self.RealDriverValvePosition == 2) and BLDisconnect and (TLDisconnect or self.BrakeLinePressure > 1.01*math.min(self.KM013offset,self.TrainToBrakeReducedPressure)) then - self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(self.KM013offset,self.TrainToBrakeReducedPressure), pr_speed,Train.EPKC.Value==0 and Train.EPK.Value > 0 and pr_speed*2 or pr_speed*0.35, nil, 1.0)-- nil, 1.0) + self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(self.KM013offset,self.TrainToBrakeReducedPressure), pr_speed,Train.EPKC and Train.EPKC.Value==0 and Train.EPK.Value > 0 and pr_speed*2 or pr_speed*0.35, nil, 1.0)-- nil, 1.0) end -- 013: 3 4.3 Atm