From fab9bb59bbaecc19ff4af8285bb256a29560ad7d Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Sun, 14 Dec 2025 15:29:14 +0300 Subject: [PATCH] New pneumatics back compatibility fix --- lua/metrostroi/systems/sys_81_717_pneumatic.lua | 11 ++++++----- lua/metrostroi/systems/sys_pr_14x_panels.lua | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lua/metrostroi/systems/sys_81_717_pneumatic.lua b/lua/metrostroi/systems/sys_81_717_pneumatic.lua index 466dd4a..bca58c7 100644 --- a/lua/metrostroi/systems/sys_81_717_pneumatic.lua +++ b/lua/metrostroi/systems/sys_81_717_pneumatic.lua @@ -411,11 +411,12 @@ function TRAIN_SYSTEM:Think(dT) Train.Panel.UAVACOpened = (1-Train.UAVAC.Value)*((CurTime()-CurTime()%0.5)%1) end - if not Train.CarCount and (Train:GetClass():match("81%-71[74]_mvm") or Train:GetClass():match("81%-71[74]_lvz")) then - if Train.IgnoreEngine == false then + if not Train.CarCount and Train.IgnoreEngine == false then + if (Train:GetClass():match("81%-71[74]_mvm") or Train:GetClass():match("81%-71[74]_lvz")) then self:TriggerInput("NewPneumatics",1) - Train.CarCount = #Train.WagonList end + Train.CarCount = #Train.WagonList + Train.InitIsoCountNeeded = true --if self.NewPneumatics == 1 then print(Format("Forein train new pneumatics installed for [%s] train class",Train:GetClass())) end end @@ -1080,7 +1081,7 @@ function TRAIN_SYSTEM:Think(dT) ---------------------------------------------------------------------------- -- Simulate compressor operation and train line depletion self.Compressor = Train.KK.Value * (Train.Electric.Aux750V > 550 and 1 or 0) - self.TrainLinePressure = self.TrainLinePressure - (Train.AirConsumeRatio or 1)*trainLineConsumption_dPdT*dT + self.TrainLinePressure = self.TrainLinePressure - (Train.AirConsumeRatio or 0.1)*trainLineConsumption_dPdT*dT if self.Compressor == 1 then self:equalizePressure(dT,"TrainLinePressure", 10.0, Train.CompressorEfficiency or 0.04) end self:equalizePressure(dT,"TrainLinePressure", 0,Train.AirLeakRatio or 0.003) -- Overpressure @@ -1100,7 +1101,7 @@ function TRAIN_SYSTEM:Think(dT) Train.AK:TriggerInput( "Close",self.TrainLinePressure < 6.3) Train.BPT:TriggerInput("Set", (IsValid(Train.FrontBogey) and Train.FrontBogey.BrakeCylinderPressure+(not Train.FrontBogey.DisableParking and Train.FrontBogey.ParkingBrakePressure or 0) or self.BrakeCylinderPressure)>0.3) Train.DKPT:TriggerInput("Set", self.BrakeCylinderPressure > 0.3) - if self.HeadCarPneumatic and self.HeadCarPneumatic == 1 or not self.NewPneumatics then + if self.HeadCarPneumatic and self.HeadCarPneumatic == 1 or self.NewPneumatics ~= 1 then Train.AVU:TriggerInput("Open", self.BrakeLinePressure < 2.7) Train.AVU:TriggerInput("Close",self.BrakeLinePressure > 3.5) Train.SOT:TriggerInput("Open", self.EPKPressure < 1.3) diff --git a/lua/metrostroi/systems/sys_pr_14x_panels.lua b/lua/metrostroi/systems/sys_pr_14x_panels.lua index 5b87d85..c84bb55 100644 --- a/lua/metrostroi/systems/sys_pr_14x_panels.lua +++ b/lua/metrostroi/systems/sys_pr_14x_panels.lua @@ -31,7 +31,7 @@ function TRAIN_SYSTEM:Initialize() -- Реле-повторитель провода 8 (РП8) self.Train:LoadSystem("Rp8","Relay","REV-811T",{open_time = 0.2,bass = true }) -- Контактор дверей (КД) - self.Train:LoadSystem("KD","Relay","REV-811T",{ bass = true, close_time = 0.5 }) + self.Train:LoadSystem("KD","Relay","REV-811T",{ bass = true, close_time = 0.3 }) -- Реле остановки (РО) self.Train:LoadSystem("RO","Relay","KPD-110E",{ bass = true, close_time = 0--[[ , close_time = 0.1--]] }) end