Teardown/teardown/mining_drill.lua

15 lines
549 B
Lua
Raw Normal View History

2024-09-15 08:10:53 +00:00
-- 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