Teardown/teardown/mining_drill.lua

15 lines
549 B
Lua

-- Populate global.max_mining_drill_radius with [Category:double]
function recompute_max_mining_drill_radius()
local max_radius = {}
local prototypes = game.get_filtered_entity_prototypes({{filter = "type", type = "mining-drill"}})
for _, prototype in pairs(prototypes) do
local categories = prototype.resource_categories or {}
for category, _ in pairs(categories) do
max_radius[category] = math.max(max_radius[category] or 0, prototype.mining_drill_radius or 0)
end
end
global.max_mining_drill_radius = max_radius
end