From 16f350963e8b696690534cab2fd3b6eb681731c1 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 19 Jun 2023 05:30:45 +0100 Subject: fix shadowing issues reported by luacheck --- server/server.lua | 3 ++- server/worldgen.lua | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'server') diff --git a/server/server.lua b/server/server.lua index 5d17e5f..a6fd42b 100644 --- a/server/server.lua +++ b/server/server.lua @@ -188,7 +188,6 @@ end local tick_interval = 1 -- seconds local last_tick_time = timenow() -local ntick = 0 local function player_near_chunk(cp) @@ -229,6 +228,8 @@ local stopping=false posix_signal.signal(posix_signal.SIGINT, function() stopping=true end) +local ntick = 0 + while true do if stopping then print("stopping...") diff --git a/server/worldgen.lua b/server/worldgen.lua index 3f318d1..80fe392 100644 --- a/server/worldgen.lua +++ b/server/worldgen.lua @@ -4,7 +4,7 @@ local chunk = require"common.chunk" local ChunkS = require"chunk".ChunkS local CHUNK_SIZE = require"common.constants".CHUNK_SIZE -local function p(amp,scale,seed) +local function P(amp,scale,seed) return { scale=scale, amp=amp, @@ -13,9 +13,9 @@ local function p(amp,scale,seed) end -- whether there is a tile there or not -local surface_ng = noise.NoiseAgg:make{p(1,20,1),p(0.5,15,2)} +local surface_ng = noise.NoiseAgg:make{P(1,20,1),P(0.5,15,2)} -- if there is a tile there, what color should it be -local color_ng = noise.NoiseAgg:make{p(1,20,3),p(0.5,15,4)} +local color_ng = noise.NoiseAgg:make{P(1,20,3),P(0.5,15,4)} local function gen_chunk(chpos) -- cgit v1.2.3