Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update belt connection delays if belt prototype speeds change. #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion connections/belt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Belt.connect = function (factory, cid, cpos, outside_entity, inside_entity)
end

Belt.recheck = function (conn)
return (conn.from.valid and conn.to.valid and conn.facing == get_conn_facing(conn.from, conn.to, opposite[conn.facing], conn.facing))
return (conn.from.valid and conn.to.valid and conn.facing == get_conn_facing(conn.from, conn.to, opposite[conn.facing], conn.facing) and delays == calc_delays(conn.from.prototype.belt_speed, conn.to.prototype.belt_speed))
end

Belt.direction = function (conn)
Expand Down
5 changes: 5 additions & 0 deletions updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,10 @@ Updates.run = function()
if gui then gui.destroy() end
end
end

--Check that all connections are still correct given any changes other mods may have made.
for _, factory in pairs(global.factories) do
Connections.recheck_factory(factory, nil, nil)
end
global.update_version = 8
end