Skip to content

Commit

Permalink
Add rest correction for even lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnwop committed Jun 22, 2020
1 parent 3b5fed4 commit 1e5639a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vehicle/ProSeedTramLines.lua
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ function ProSeedTramLines:onUpdateTick(dt)
end

if spec.tramLineMode ~= ProSeedTramLines.TRAMLINE_MODE_MANUAL then
local laneForTramLine = math.floor((lanesForDistance / 2) + 0.5)
local rest = lanesForDistance % 2 ~= 0 and 0 or 1
local laneForTramLine = math.floor((lanesForDistance / 2) + 0.5) + rest
--We create lines when we can divide.
spec.createTramLines = spec.currentLane == laneForTramLine
end
Expand Down

0 comments on commit 1e5639a

Please sign in to comment.