Fix error in command blocks (#30)

Possibly caused by force-loaded blocks.
This commit is contained in:
luk3yx 2023-04-08 03:20:43 +12:00 committed by GitHub
parent 13645134a6
commit 464699e78b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -52,11 +52,11 @@ local function receive_fields(pos, _, fields, player)
end
local function resolve_commands(commands, pos)
local nearest = nil
local nearest = ""
local min_distance = math.huge
local players = minetest.get_connected_players()
for _, player in pairs(players) do
local distance = vector.distance(pos, player:getpos())
local distance = vector.distance(pos, player:get_pos())
if distance < min_distance then
min_distance = distance
nearest = player:get_player_name()