forked from Mineclonia/Mineclonia
Compare commits
1 Commits
master
...
fix-malfor
Author | SHA1 | Date |
---|---|---|
cora | 76b6815a7a |
|
@ -204,3 +204,26 @@ local test_minetest_find_nodes_in_area_implementation_equivalence = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.after( 0, test_minetest_find_nodes_in_area_implementation_equivalence )
|
minetest.after( 0, test_minetest_find_nodes_in_area_implementation_equivalence )
|
||||||
|
|
||||||
|
--Workaround for Minetest bug #12073
|
||||||
|
-- <https://github.com/minetest/minetest/issues/12073#issuecomment-1039389509>
|
||||||
|
minetest.register_on_joinplayer(function(p)
|
||||||
|
p:get_meta():set_string("joined","true")
|
||||||
|
end)
|
||||||
|
minetest.register_on_leaveplayer(function(p)
|
||||||
|
p:get_meta():set_string("joined","")
|
||||||
|
end)
|
||||||
|
|
||||||
|
local function is_real_player(p)
|
||||||
|
if p:get_meta():get("joined") then return true end
|
||||||
|
end
|
||||||
|
|
||||||
|
local mgcp = minetest.get_connected_players
|
||||||
|
|
||||||
|
function minetest.get_connected_players()
|
||||||
|
local pp={}
|
||||||
|
for k,p in pairs(mgcp()) do
|
||||||
|
if is_real_player(p) then table.insert(pp,p) end
|
||||||
|
end
|
||||||
|
return pp
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue