1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

fixed bug

This commit is contained in:
grilledham 2018-02-23 12:18:32 +00:00
parent 95f4758670
commit 0c70213fb9
3 changed files with 81 additions and 89 deletions

View File

@ -5,8 +5,7 @@ map_gen_rows_per_tick = 8 -- Inclusive integer between 1 and 32. Used for map_ge
--require "map_gen.shared.generate_not_threaded"
require "map_gen.shared.generate"
local function no_resources(x, y, world_x, world_y, tile, entity)
local surface = MAP_GEN_SURFACE
local function no_resources(x, y, world_x, world_y, tile, entity, surface)
for _, e in ipairs(surface.find_entities_filtered({type = "resource", area = {{world_x, world_y}, {world_x + 1, world_y + 1}}})) do
e.destroy()
end
@ -14,8 +13,7 @@ local function no_resources(x, y, world_x, world_y, tile, entity)
return tile, entity
end
local function less_resources(x, y, world_x, world_y, tile, entity)
local surface = MAP_GEN_SURFACE
local function less_resources(x, y, world_x, world_y, tile, entity, surface)
for _, e in ipairs(surface.find_entities_filtered({type = "resource", area = {{world_x, world_y}, {world_x + 1, world_y + 1}}})) do
if e.name == "crude-oil" then
-- e.amount = .995 * e.amount
@ -27,8 +25,7 @@ local function less_resources(x, y, world_x, world_y, tile, entity)
return tile, entity
end
local function no_enemies(x, y, world_x, world_y, tile, entity)
local surface = MAP_GEN_SURFACE
local function no_enemies(x, y, world_x, world_y, tile, entity, surface)
for _, e in ipairs(surface.find_entities_filtered({force = "enemy", position = {world_x, world_y}})) do
e.destroy()
end
@ -54,7 +51,6 @@ shape = apply_effect(shape, no_enemies)
local shape2 = compound_and{big_dot, invert(small_dot)}
shape2 = choose(big_dot, shape2, compound_or{arms, rotate(arms, degrees(45))})
--shape2 = apply_effect(shape2, less_resources)
local start = apply_effect(mediumn_dot, no_resources)
local iron = circle_builder(16)

View File

@ -8,8 +8,7 @@ local function value(base, mult)
end
end
local function no_resources(x, y, world_x, world_y, tile, entity)
local surface = MAP_GEN_SURFACE
local function no_resources(x, y, world_x, world_y, tile, entity, surface)
for _, e in ipairs(surface.find_entities_filtered({ type = "resource", area = {{world_x, world_y }, {world_x + 1, world_y + 1 } } })) do
e.destroy()
end

View File

@ -22,7 +22,6 @@ local line2 = rotate(line2, degrees(-45))
line2 = translate(line2, 55.5, -23.6875)
--line2 =change_tile(line2, true, "water")
local half = compound_or({line2, line1, circle})
half = translate(half, -79.1875, 0)
@ -53,8 +52,7 @@ end
local init = false
local safe_distance = 480
local function effect(x, y, world_x, world_y, tile, entity)
local surface = MAP_GEN_SURFACE
local function effect(x, y, world_x, world_y, tile, entity, surface)
if not init then
init = true
@ -107,7 +105,6 @@ local function effect(x, y, world_x, world_y, tile, entity)
end
--]]
return tile, entity
end