From bb9655e2afefcd40b7d341719ea58b5955f53f99 Mon Sep 17 00:00:00 2001 From: plague006 Date: Sun, 27 Jan 2019 14:45:08 -0500 Subject: [PATCH] infinite_mazes: drop unused return DiggyCaveCollapse: define mask_init earlier Dimensions: comment uncalled function --- map_gen/Diggy/Feature/DiggyCaveCollapse.lua | 7 +++++-- map_gen/combined/dimensions.lua | 3 +++ map_gen/shape/infinite_mazes.lua | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/map_gen/Diggy/Feature/DiggyCaveCollapse.lua b/map_gen/Diggy/Feature/DiggyCaveCollapse.lua index e9f85e75..37233576 100644 --- a/map_gen/Diggy/Feature/DiggyCaveCollapse.lua +++ b/map_gen/Diggy/Feature/DiggyCaveCollapse.lua @@ -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 diff --git a/map_gen/combined/dimensions.lua b/map_gen/combined/dimensions.lua index ebc09c4f..8e8c505b 100644 --- a/map_gen/combined/dimensions.lua +++ b/map_gen/combined/dimensions.lua @@ -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 diff --git a/map_gen/shape/infinite_mazes.lua b/map_gen/shape/infinite_mazes.lua index 1372ddbc..b981b282 100644 --- a/map_gen/shape/infinite_mazes.lua +++ b/map_gen/shape/infinite_mazes.lua @@ -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)