1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-06 09:50:23 +02:00

Shortened Code

xyzz's suggestion to shorten the code
This commit is contained in:
fairiestoy
2013-09-29 11:59:11 +02:00
parent c929939aa5
commit 6917033d17

View File

@ -43,15 +43,11 @@ end
local player_list = {}
minetest.register_on_joinplayer(function(player)
table.insert(player_list, player)
player_list[player:get_player_name()] = player
end)
minetest.register_on_leaveplayer(function(player)
for index, value in pairs(player_list) do
if player:get_player_name() == value:get_player_name() then
table.remove(player_list, index)
end
end
player_list[player:get_player_name()] = nil
end)
function minetest.get_connected_players()