summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-06-19 05:30:45 +0100
committerubq323 <ubq323@ubq323.website>2023-06-19 05:30:45 +0100
commit16f350963e8b696690534cab2fd3b6eb681731c1 (patch)
tree8b221d3db7d5b97c4468c95d2d39e52d719505ee
parentf55c9f415a081a175e48b51db894f23e59ce47a2 (diff)
fix shadowing issues reported by luacheck
-rwxr-xr-xcheck.sh4
-rw-r--r--client/drawing2.lua2
-rw-r--r--client/game.lua1
-rw-r--r--server/server.lua3
-rw-r--r--server/worldgen.lua6
5 files changed, 8 insertions, 8 deletions
diff --git a/check.sh b/check.sh
index 6c3aa34..3710d54 100755
--- a/check.sh
+++ b/check.sh
@@ -1,7 +1,7 @@
#!/bin/sh
luacheck . \
- --std=love+luajit --no-unused --no-redefined --ignore 611 \
+ --std=love+luajit --no-unused --ignore 611 \
--max-line-length 70 \
- -q \
+ -q --codes \
--exclude-files '**/dkjson.lua' --exclude-files '*/common/*'
diff --git a/client/drawing2.lua b/client/drawing2.lua
index 800df78..5c39a93 100644
--- a/client/drawing2.lua
+++ b/client/drawing2.lua
@@ -126,7 +126,7 @@ local function set_imesh(im)
shape_mesh:attachAttribute("tile_type",im,"perinstance")
end
-local function draw_map(camera,map)
+local function draw_map(camera,map) -- luacheck: no redefined
shader:send("zoom",camera.zoom)
love.graphics.setShader(shader)
diff --git a/client/game.lua b/client/game.lua
index 2c259a6..081bcb7 100644
--- a/client/game.lua
+++ b/client/game.lua
@@ -345,7 +345,6 @@ local function draw()
end
if ui_mode == "chat" then
- local W,H = love.graphics.getDimensions()
chatmsg_text:set("- "..this_chatmsg)
local tw,th = chatmsg_text:getDimensions()
local y = H-th-30
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)