mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
infinite_mazes: drop unused return
DiggyCaveCollapse: define mask_init earlier Dimensions: comment uncalled function
This commit is contained in:
parent
4738f3e043
commit
bb9655e2af
@ -12,6 +12,7 @@ local Global = require 'utils.global'
|
||||
local Game = require 'utils.game'
|
||||
local CreateParticles = require 'features.create_particles'
|
||||
local RS = require 'map_gen.shared.redmew_surface'
|
||||
local table = require 'utils.table'
|
||||
|
||||
local random = math.random
|
||||
local floor = math.floor
|
||||
@ -24,6 +25,7 @@ local raise_event = script.raise_event
|
||||
local set_timeout = Task.set_timeout
|
||||
local set_timeout_in_ticks = Task.set_timeout_in_ticks
|
||||
local ceiling_crumble = CreateParticles.ceiling_crumble
|
||||
local clear_table = table.clear_table
|
||||
local collapse_rocks = Template.diggy_rocks
|
||||
local collapse_rocks_size = #collapse_rocks
|
||||
|
||||
@ -51,6 +53,7 @@ local ring_value = 0
|
||||
local enable_stress_grid = 0
|
||||
local stress_map_add
|
||||
local mask_disc_blur
|
||||
local mask_init
|
||||
local stress_map_check_stress_in_threshold
|
||||
local support_beam_entities
|
||||
local on_surface_created
|
||||
@ -512,7 +515,7 @@ on_surface_created = function(event)
|
||||
local index = event.surface_index
|
||||
|
||||
if stress_map_storage[index] then
|
||||
table.clear_table(stress_map_storage[index])
|
||||
clear_table(stress_map_storage[index])
|
||||
else
|
||||
stress_map_storage[index] = {}
|
||||
end
|
||||
@ -579,7 +582,7 @@ DiggyCaveCollapse.stress_map_add = stress_map_add
|
||||
-- MASK
|
||||
--
|
||||
|
||||
function mask_init(config)
|
||||
mask_init = function(config) -- luacheck: ignore 431 (intentional upvalue shadow)
|
||||
n = config.mask_size
|
||||
local ring_weights = config.mask_relative_ring_weights
|
||||
|
||||
|
@ -61,6 +61,8 @@ local function generate_nihil(event)
|
||||
event.surface.set_tiles(tiles)
|
||||
end
|
||||
|
||||
--[[
|
||||
Nothihng calls run_combined_module and I'm not sure what to do with it since it seems to want an event to trigger it
|
||||
function run_combined_module(event)
|
||||
init()
|
||||
if event.surface.name == 'Zerus' then
|
||||
@ -69,6 +71,7 @@ function run_combined_module(event)
|
||||
generate_nihil(event)
|
||||
end
|
||||
end
|
||||
]]
|
||||
|
||||
local function teleport_nearby_players(portal)
|
||||
for _, player_character in pairs(portal.source.find_entities_filtered {area = {{portal.position.x - global.portal_radius, portal.position.y - global.portal_radius}, {portal.position.x + global.portal_radius, portal.position.y + global.portal_radius}}, name = 'player', type = 'player'}) do
|
||||
|
@ -26,7 +26,7 @@ local resource_density_factor = 500
|
||||
--Warning: Do not exceed the total number of cells in the maze, or it will break!
|
||||
|
||||
--DO NOT TOUCH BELOW THIS LINE--
|
||||
|
||||
local _ -- garbage collection var
|
||||
local bor = bit32.bor
|
||||
local bxor = bit32.bxor
|
||||
local band = bit32.band
|
||||
@ -132,7 +132,7 @@ local function get_maze(x, y, seed, width, height)
|
||||
value = rshift(value, 16)
|
||||
maze_data[1][value % height + 1] = band(maze_data[1][value % height + 1], 2)
|
||||
|
||||
maze_seed, value = get_random_maze_val(maze_seed)
|
||||
_, value = get_random_maze_val(maze_seed)
|
||||
maze_data[width + 1] = {0, 0}
|
||||
maze_data[width + 1][1] = value % width + 1
|
||||
value = rshift(value, 16)
|
||||
|
Loading…
Reference in New Issue
Block a user