Skip to content

Commit

Permalink
Fix upgrade planner and Ultimate Belts mining bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mspielberg committed May 24, 2018
1 parent 953b0a7 commit b016568
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ least one filter.
__Ultimate Belts support is in BETA state.__

Factorio core engine limitations restrict inserters pulling from belts to
60items/second, or 4.5x yellow belt speed. Further, loader entities are
60 items/second, or 4.5x yellow belt speed. Further, loader entities are
restricted to 120 items/second.

Miniloaders at "Ultra fast" and faster speeds use vanilla loader entities in
addition to inserters, giving a max throughput of ~180 items/secondwhen
addition to inserters, giving a max throughput of ~180 items/second when
interacting with chests and other containers. They will _not_ give full
throughput when loading cargo wagons, and circuit control is disabled since
vanilla loaders cannot be circuit controlled.
Expand Down Expand Up @@ -177,4 +177,7 @@ vanilla loaders cannot be circuit controlled.
* Fix upgrade planner crash where loader belts have insufficient room for items.
* Work around for bug in Creative Mode's instant deconstruction cheat.
* Fix icon appearance when other mods add multi-layer icons to underground belts.
* Fix case where mining the last entity connected to a miniloader via circuit left the miniloader inoperative.
* Fix case where mining the last entity connected to a miniloader via circuit left the miniloader inoperative.
* 1.5.21 (2018-05-24):
* Fix Ultimate Belts miniloaders not yielding an item when mined.
* Fix bug with Upgrade Planner integration that could sometimes cause upgraded miniloaders to not be returned to the player's inventory.
24 changes: 12 additions & 12 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ end
local function on_miniloader_mined(ev)
local entity = ev.entity
local inserters = util.get_loader_inserters(entity)
if ev.buffer and inserters[1] then
local _, item_to_place = next(inserters[1].prototype.items_to_place_this)
ev.buffer.insert{count=1, name=item_to_place.name}
end
for i=1,#inserters do
-- return items to player / robot if mined
if ev.buffer and inserters[i] ~= entity and inserters[i].held_stack.valid_for_read then
Expand All @@ -165,22 +169,18 @@ local function on_miniloader_inserter_mined(ev)
position = entity.position,
type = "loader",
}[1]
if not loader then
if loader then
if ev.buffer then
ev.buffer.clear()
end
return
end
if ev.buffer then
for i=1,2 do
local tl = loader.get_transport_line(i)
for j=1,#tl do
ev.buffer.insert(tl[j])
for i=1,2 do
local tl = loader.get_transport_line(i)
for j=1,#tl do
ev.buffer.insert(tl[j])
end
tl.clear()
end
tl.clear()
end
loader.destroy()
end
loader.destroy()

local inserters = util.get_loader_inserters(entity)
for i=2,#inserters do
Expand Down
1 change: 1 addition & 0 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ local function create_inserters(prefix, base_underground_name)
minable = { mining_time = 1, result = loader_name },
collision_box = {{-0.2, -0.2}, {0.2, 0.2}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
selection_priority = 50,
allow_custom_vectors = true,
energy_per_movement = 2000,
energy_per_rotation = 2000,
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miniloader",
"version": "1.5.20",
"version": "1.5.21",
"factorio_version": "0.16",
"title": "Miniloader",
"author": "Therax",
Expand Down

0 comments on commit b016568

Please sign in to comment.