Connavar's infinite ores


Respawn depleted ores (true infinite ores)

Content
1 year, 11 months ago
1.0 - 1.1
861
Mining

i Suggestions

1 year, 11 months ago
(updated 1 year, 11 months ago)

The mod looks nice, but i have a couple suggestions to increase its performance potentially.
1) The amount it adds on depletion is small at 1000. In a megabase scale and with speed upgrades that could happen rapidly in several veins simultaneously. This value could also come from mod settings, defaulting at 100000?
2) The condition in the function can be moved outside, to toggle the event itself from being active.
3) Typo ;) "intinite" should be "infinite".
4) Default for infinite ores being enabled should be "true". Currently without going to mod settings and changing it, the mod won't do a thing. This is confusing for people who prefer playing all things default. That they install this mod already tells they want infinite ores.

After changes:
local infinite_ores_enabled = settings.global["wedol-infinite-ores"].value

local function on_resource_depleted(event)
event.entity.amount = 100000
end

if infinite_ores_enabled then
script.on_event(defines.events.on_resource_depleted, on_resource_depleted)
end

I checked that it compiles ingame.

New response