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

Add additional flag for check occupation in controller logic

This commit is contained in:
alexandr_sizov
2021-12-29 10:59:33 +03:00
parent 1f28ae564e
commit d857df7db5

View File

@@ -201,6 +201,7 @@ function ENT:Initialize()
self.Controllers = nil
self.OccupiedOld = false;
self.ControllerLogicCheckOccupied = false;
end
function ENT:PreInitalize()
@@ -645,12 +646,15 @@ function ENT:Think()
end
else
local number = self.RouteNumberReplace or ""
--[[self.PrevTime = self.PrevTime or 0
if (CurTime() - self.PrevTime) > 1.0 then
self.PrevTime = CurTime()+math.random(0.5,1.5)
self:ARSLogic(self.PrevTime - CurTime())
self:CheckOccupation()
end]]
if self.ControllerLogicCheckOccupied then
self.PrevTime = self.PrevTime or 0
if (CurTime() - self.PrevTime) > 1.0 then
self.PrevTime = CurTime() + math.random(0.5,1.5)
if self.Node and self.TrackPosition then
self.Occupied,self.OccupiedBy,self.OccupiedByNow = Metrostroi.IsTrackOccupied(self.Node, self.TrackPosition.x,self.TrackPosition.forward,self.ARSOnly and "ars" or "light", self)
end
end
end
--[[
if self.MU or self.ARSOnly or self.RouteNumberSetup and self.RouteNumberSetup ~= "" or self.RouteNumber and self.RouteNumber ~= "" then
if self.NextSignalLink then