1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-05 15:05:57 +02:00

More Build checks

This commit is contained in:
Soggs 2021-05-19 18:25:51 +02:00
parent 480de9f27f
commit e769ec0f61

View File

@ -1,15 +1,12 @@
local Helper = require 'map_gen.maps.danger_ores.modules.helper'
local b = require 'map_gen.shared.builders'
local table = require 'utils.table'
local seed_provider = require 'map_gen.maps.danger_ores.modules.seed_provider'
local binary_search = table.binary_search
local bnot = bit32.bnot
local sqrt = math.sqrt
local floor = math.floor
local function no_op()
end
return function(config)
local main_ores = config.main_ores
@ -20,7 +17,7 @@ return function(config)
local function condition_factory(ore_name)
return function(x, y, _)
local scale = config.circle_scale or 1
local randomize_scale = config.randomize_scale or false
--local randomize_scale = config.randomize_scale or false
local ore_table = {}
for _, ore_data in pairs(main_ores) do
table.insert(ore_table, {name = ore_data.name, weight = ore_data.weight})
@ -42,11 +39,11 @@ return function(config)
local ore_name = ore_data.name
local tiles = ore_data.tiles
local land = tile_builder(tiles)
local ratios = ore_data.ratios
local weighted = b.prepare_weighted_array(ratios)
local amount = ore_data.start
local ore = ore_builder(ore_name, amount, ratios, weighted)
local condition = condition_factory(config, ore_name)
local shape = b.choose(condition, b.apply_entity(land, ore), b.empty_shape)