Various code fixes detected by luacheck
* Luablock: Fix the missing position argument when executing the lua code fails * Wireless: Fix the missing id argument * Localize several variables * Some other small changes, e.g. dead code removal
このコミットが含まれているのは:
@@ -24,12 +24,12 @@ local function teleport_nearest(pos)
|
||||
|
||||
-- Search for the nearest player
|
||||
local nearest = nil
|
||||
local min_distance = MAX_PLAYER_DISTANCE
|
||||
local min_distance_player = MAX_PLAYER_DISTANCE
|
||||
local players = minetest.get_connected_players()
|
||||
for _, player in pairs(players) do
|
||||
local distance = vector.distance(pos, player:getpos())
|
||||
if distance <= min_distance then
|
||||
min_distance = distance
|
||||
if distance <= min_distance_player then
|
||||
min_distance_player = distance
|
||||
nearest = player
|
||||
end
|
||||
end
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする