Revert "fix issue 106 and bump version"

This reverts commit 3df1e76715.
This commit is contained in:
Gillett Hernandez
2023-10-01 17:35:01 -07:00
parent 3df1e76715
commit 9e65a5d6c5
2 changed files with 40 additions and 64 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cybersyn",
"version": "1.2.17",
"version": "1.2.16",
"title": "Project Cybersyn",
"author": "Mami",
"factorio_version": "1.1",
+12 -36
View File
@@ -33,7 +33,6 @@ function is_refuel_layout_accepted(layout_pattern, layout)
end
return valid
end
---@param layout_pattern (0|1|2|3)[]
---@param layout (0|1|2)[]
function is_layout_accepted(layout_pattern, layout)
@@ -84,6 +83,7 @@ function remove_train(map_data, train_id, train)
interface_raise_train_removed(train_id, train)
end
---@param map_data MapData
---@param train Train
function set_train_layout(map_data, train)
@@ -228,11 +228,7 @@ function set_p_wagon_combs(map_data, station, train)
local count_to_fill = min(item_slots_capacity*stack_size, item_count)
local slots_to_fill = ceil(count_to_fill/stack_size)
signals[i] = {
index = i,
signal = { type = item.type, name = item.name },
count = sign * count_to_fill
}
signals[i] = {index = i, signal = {type = item.type, name = item.name}, count = sign*count_to_fill}
item_count = item_count - count_to_fill
item_slots_capacity = item_slots_capacity - slots_to_fill
if comb then
@@ -274,11 +270,7 @@ function set_p_wagon_combs(map_data, station, train)
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 = sign * count_to_fill
}
signals[1] = {index = 1, signal = {type = fluid.type, name = fluid.name}, count = sign*count_to_fill}
fluid_count = fluid_count - count_to_fill
fluid_capacity = 0
do_inc = fluid_count == 0
@@ -331,12 +323,7 @@ function set_r_wagon_combs(map_data, station, train)
local stack = inv[stack_i]
if stack.valid_for_read then
local i = #signals + 1
signals[i] = {
index = i,
signal = { type = "item", name = stack.name },
count = sign *
stack.count
}
signals[i] = {index = i, signal = {type = "item", name = stack.name}, count = sign*stack.count}
end
end
set_combinator_output(map_data, comb, signals)
@@ -354,6 +341,7 @@ function set_r_wagon_combs(map_data, station, train)
end
end
---@param map_data MapData
---@param refueler Refueler
---@param train Train
@@ -400,11 +388,7 @@ function set_refueler_combs(map_data, refueler, train)
if stack.valid_for_read then
if comb then
local i = #wagon_signals + 1
wagon_signals[i] = {
index = i,
signal = { type = "item", name = stack.name },
count = stack.count
}
wagon_signals[i] = {index = i, signal = {type = "item", name = stack.name}, count = stack.count}
end
local j = #signals + 1
signals[j] = {index = j, signal = {type = "item", name = stack.name}, count = stack.count}
@@ -419,6 +403,7 @@ function set_refueler_combs(map_data, refueler, train)
set_combinator_output(map_data, refueler.entity_comb, signals)
end
---@param map_data MapData
---@param stop Station|Refueler
function unset_wagon_combs(map_data, stop)
@@ -436,7 +421,7 @@ function unset_wagon_combs(map_data, stop)
end
end
local type_filter = { "inserter", "pump", "arithmetic-combinator", "loader-1x1", "loader" }
local type_filter = {"inserter", "pump", "arithmetic-combinator", "loader-1x1"}
---@param map_data MapData
---@param stop Station|Refueler
---@param is_station_or_refueler boolean
@@ -490,8 +475,7 @@ function reset_stop_layout(map_data, stop, is_station_or_refueler, forbidden_ent
local wagon_number = 0
for i = 1, 112 do
if pre_rail then
local rail, rail_direction, rail_connection_direction = pre_rail.get_connected_rail({
rail_direction = rail_direction_from_stop, rail_connection_direction = defines_straight })
local rail, rail_direction, rail_connection_direction = pre_rail.get_connected_rail({rail_direction = rail_direction_from_stop, rail_connection_direction = defines_straight})
if not rail or rail_connection_direction ~= defines_straight then
-- There is a curved rail or break in the tracks at this point
-- We are assuming it's a curved rail, maybe that's a bad assumption
@@ -559,7 +543,7 @@ function reset_stop_layout(map_data, stop, is_station_or_refueler, forbidden_ent
end
end
end
elseif entity.type == "loader-1x1" or entity.type == "loader" then
elseif entity.type == "loader-1x1" then
if not supports_cargo then
local direction = entity.direction
if is_ver then
@@ -677,10 +661,7 @@ function update_stop_from_rail(map_data, rail, forbidden_entity, force)
resolve_update_stop_from_rail(map_data, entity, forbidden_entity, force)
return
end
rail_back = rail_back.get_connected_rail({
rail_direction = defines_back,
rail_connection_direction = defines_straight
})
rail_back = rail_back.get_connected_rail({rail_direction = defines_back, rail_connection_direction = defines_straight})
end
if rail_front then
local entity = rail_front.get_rail_segment_entity(defines_front, false)
@@ -688,10 +669,7 @@ function update_stop_from_rail(map_data, rail, forbidden_entity, force)
resolve_update_stop_from_rail(map_data, entity, forbidden_entity, force)
return
end
rail_front = rail_front.get_connected_rail({
rail_direction = defines_front,
rail_connection_direction = defines_straight
})
rail_front = rail_front.get_connected_rail({rail_direction = defines_front, rail_connection_direction = defines_straight})
end
end
end
@@ -704,7 +682,6 @@ function update_stop_from_pump(map_data, pump, forbidden_entity)
update_stop_from_rail(map_data, pump.pump_rail_target, forbidden_entity)
end
end
---@param map_data MapData
---@param inserter LuaEntity
---@param forbidden_entity LuaEntity?
@@ -755,7 +732,6 @@ function update_stop_from_inserter(map_data, inserter, forbidden_entity)
update_stop_from_rail(map_data, rails[1], forbidden_entity)
end
end
---@param map_data MapData
---@param loader LuaEntity
---@param forbidden_entity LuaEntity?