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

fix: wagon controls now output fluid signals #253

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion cybersyn/scripts/layout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,17 @@ function set_p_wagon_combs(map_data, station, train)
---@type LogisticFilter[]
local signals = {}

-- TODO: this is a weird copypasta of the above loop but is not needed
-- since fluid wagons can only ever have one fluid in them...
while fluid_capacity > 0 and fluid_i <= #manifest do
local do_inc
if fluid.type == "fluid" then
local count_to_fill = min(fluid_count, fluid_capacity)

signals[1] = { index = 1, signal = { type = fluid.type, name = fluid.name }, count = -1 * count_to_fill }
signals[1] = {
value = { type = fluid.type, name = fluid.name, quality = "normal", comparator = "=" },
min = -count_to_fill,
}
fluid_count = fluid_count - count_to_fill
fluid_capacity = 0
do_inc = fluid_count == 0
Expand Down