[0.18.26] Mining drills mine their last resource twice
Posted: Mon May 25, 2020 3:51 am
I have been trying to figure out how mining drills work so I can accurately represent mining drill rates in my Rate Calculator mod. While experimenting, I discovered that whichever resource is at the end of the drill's "list" gets two sets of mining operations (mined 20 times instead of 10).
Here is a video demonstrating the bug in action:
Here is the code for the "resource tracker" mod I created to help debug this:
Here is a video demonstrating the bug in action:
Here is the code for the "resource tracker" mod I created to help debug this:
Code: Select all
local draw_text = rendering.draw_text
local clear = rendering.clear
script.on_nth_tick(10, function()
clear()
local nauvis = game.surfaces.nauvis
local resources = nauvis.find_entities_filtered{
type = "resource"
}
for _, resource in ipairs(resources) do
draw_text{
text = resource.amount,
surface = nauvis,
target = resource,
color = {r=1, g=1, b=1},
}
end
end)