Merge pull request #50 from rbandl/main

Fixed inaccurate automatic allow-lists in some cases when using loaders
This commit is contained in:
Monica Moniot
2023-03-24 14:37:38 -04:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -690,7 +690,7 @@ function update_stop_from_loader(map_data, loader, forbidden_entity)
update_stop_from_rail(map_data, rails[1], forbidden_entity)
end
elseif direction == defines.direction.south then
position.y = position.y - 1 -- input and facing south -> move on Y axis down 1 unit
position.y = position.y + 1 -- input and facing south -> move on Y axis down 1 unit
local rails = surface.find_entities_filtered({
type = "straight-rail",
position = position,
@@ -710,7 +710,7 @@ function update_stop_from_loader(map_data, loader, forbidden_entity)
update_stop_from_rail(map_data, rails[1], forbidden_entity)
end
elseif direction == defines.direction.north then
position.y = position.y + 1 -- input and facing south -> move on Y axis up 1 unit
position.y = position.y - 1 -- input and facing south -> move on Y axis up 1 unit
local rails = surface.find_entities_filtered({
type = "straight-rail",
position = position,
@@ -732,7 +732,7 @@ function update_stop_from_loader(map_data, loader, forbidden_entity)
update_stop_from_rail(map_data, rails[1], forbidden_entity)
end
elseif direction == defines.direction.south then
position.y = position.y + 1 -- output and facing south -> move on Y axis up 1 unit
position.y = position.y - 1 -- output and facing south -> move on Y axis up 1 unit
local rails = surface.find_entities_filtered({
type = "straight-rail",
position = position,
@@ -752,7 +752,7 @@ function update_stop_from_loader(map_data, loader, forbidden_entity)
update_stop_from_rail(map_data, rails[1], forbidden_entity)
end
elseif direction == defines.direction.north then
position.y = position.y - 1 -- output and facing south -> move on Y axis down 1 unit
position.y = position.y + 1 -- output and facing south -> move on Y axis down 1 unit
local rails = surface.find_entities_filtered({
type = "straight-rail",
position = position,

View File

@@ -639,7 +639,7 @@ local function on_broken(event)
elseif entity.type == "inserter" then
update_stop_from_inserter(global, entity, entity)
elseif entity.type == "loader-1x1" then
update_stop_from_loader(global, entity)
update_stop_from_loader(global, entity, entity)
elseif entity.type == "pump" then
update_stop_from_pump(global, entity, entity)
elseif entity.type == "straight-rail" then