mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2024-11-19 21:53:50 +01:00
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
|
end
|
||||||
|
|
||||||
local function resolve_commands(commands, pos)
|
local function resolve_commands(commands, pos)
|
||||||
local nearest = nil
|
local nearest = ""
|
||||||
local min_distance = math.huge
|
local min_distance = math.huge
|
||||||
local players = minetest.get_connected_players()
|
local players = minetest.get_connected_players()
|
||||||
for _, player in pairs(players) do
|
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
|
if distance < min_distance then
|
||||||
min_distance = distance
|
min_distance = distance
|
||||||
nearest = player:get_player_name()
|
nearest = player:get_player_name()
|
||||||
|
Loading…
Reference in New Issue
Block a user