forked from minetest-mods/MoreMesecons
Fix error in command blocks (#30)
Possibly caused by force-loaded blocks.
This commit is contained in:
parent
13645134a6
commit
464699e78b
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user