mirror of
https://github.com/metrostroi-repo/MetrostroiAddon.git
synced 2026-05-04 00:52:33 +00:00
81-717/714 pneumatics merged in one system. Door pneumatics added. Back compatibility added. Doors initial states bugfixed. Brake VZs logic slightly modified
This commit is contained in:
@@ -88,12 +88,12 @@ ENT.Spawner = {
|
||||
if ent._SpawnerStarted~=val then
|
||||
ent.VB:TriggerInput("Set",val<=2 and 1 or 0)
|
||||
ent.ParkingBrake:TriggerInput("Set",val==3 and 1 or 0)
|
||||
ent.Pneumatic.LeftDoorState = val ~= 4 and {1,1,1,1} or {0,0,0,0}
|
||||
ent.Pneumatic.RightDoorState = val ~= 4 and {1,1,1,1} or {0,0,0,0}
|
||||
for _i = 1,4 do
|
||||
ent.Pneumatic.DSprev[_i][1] = ent.Pneumatic.RightDoorState[_i]
|
||||
ent.Pneumatic.DSprev[_i][2] = ent.Pneumatic.LeftDoorState[_i]
|
||||
end
|
||||
ent.Pneumatic.LeftDoorState = val == 4 and {1,1,1,1} or {0,0,0,0}
|
||||
ent.Pneumatic.RightDoorState = val == 4 and {1,1,1,1} or {0,0,0,0}
|
||||
for i = 1,4 do
|
||||
ent:SetPackedRatio("DoorL"..i,ent.Pneumatic.LeftDoorState[i])
|
||||
ent:SetPackedRatio("DoorR"..i,ent.Pneumatic.RightDoorState[i])
|
||||
end
|
||||
ent.Pneumatic.DoorLeft = val == 4 and true or false
|
||||
ent.Pneumatic.DoorRight = val == 4 and true or false
|
||||
if ent.AR63 then
|
||||
@@ -129,6 +129,16 @@ ENT.Spawner = {
|
||||
ent.GV:TriggerInput("Set",val<4 and 1 or 0)
|
||||
ent._SpawnerStarted = val
|
||||
end
|
||||
--------------------------------------
|
||||
if ent.Pneumatic.NewSystem == 1 then
|
||||
ent.DoorLinePressure = val == 3 and math.random()*3.6 or 3.6
|
||||
ent.LeftDoorCloseCylPressure = val == 4 and 0.0 or 3.6
|
||||
ent.LeftDoorOpenCylPressure = val == 4 and 3.6 or 0.0
|
||||
ent.RightDoorCloseCylPressure = val == 4 and 0.0 or 3.6
|
||||
ent.RightDoorOpenCylPressure = val == 4 and 3.6 or 0.0
|
||||
if ent.AR63 then ent._1stRightDoorCloseCylPressure = 0.0 end
|
||||
end
|
||||
--------------------------------------
|
||||
ent.Pneumatic.TrainLinePressure = val==3 and math.random()*4 or val==2 and 4.5+math.random()*3 or 7.6+math.random()*0.6
|
||||
ent.Pneumatic.BrakeLinePressure = val == 4 and 5.2 or val == 1 and 2.3 or math.min(ent.Pneumatic.TrainLinePressure+0.25,math.random()*4)
|
||||
ent.Pneumatic.WorkingChamberPressure = val==3 and math.random()*1.0 or val==2 and 4.0+math.random()*1.0 or 5.2
|
||||
|
||||
Reference in New Issue
Block a user