Fix multiplayer support

This commit is contained in:
Hybrid Dog 2017-09-07 21:00:55 +02:00
parent b56c1792de
commit 69a68cb247

@ -55,8 +55,7 @@ if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
end
end
local function pickupfunc()
for _,player in ipairs(minetest.get_connected_players()) do
local function pickupfunc(player)
local keys_pressed = not key_triggered
local control = player:get_player_control()
@ -96,9 +95,7 @@ if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
return
end
end
if inv:room_for_item("main",
ItemStack(ent.itemstring)
) then
if inv:room_for_item("main", ItemStack(ent.itemstring)) then
local pos2 = object:getpos()
local distance = vector.distance(pos, pos2)
if distance <= 1 then
@ -127,10 +124,12 @@ if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
end
end
end
end
local function pickup_step()
pickupfunc()
local players = minetest.get_connected_players()
for i = 1,#players do
pickupfunc(players[i])
end
minetest.after(0.01, pickup_step)
end
minetest.after(3.0, pickup_step)