mirror of https://github.com/minetest/minetest.git
Adjusted coding style
Adjusted the coding style of commitf12f74c
bfabc52
to fit the general coding style of the builtin lua routines
This commit is contained in:
parent
bfabc52841
commit
c125b5d914
|
@ -42,24 +42,24 @@ end
|
||||||
|
|
||||||
local player_list = {}
|
local player_list = {}
|
||||||
|
|
||||||
minetest.register_on_joinplayer( function( player_ref )
|
minetest.register_on_joinplayer( function(player)
|
||||||
if player_ref:is_player() then
|
if player:is_player() then
|
||||||
table.insert( player_list, player_ref )
|
table.insert(player_list, player)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_leaveplayer( function( player_ref )
|
minetest.register_on_leaveplayer(function(player)
|
||||||
for index, value in pairs( player_list ) do
|
for index, value in pairs(player_list) do
|
||||||
if player_ref:get_player_name() == value:get_player_name() then
|
if player:get_player_name() == value:get_player_name() then
|
||||||
table.remove( player_list, index )
|
table.remove(player_list, index)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function minetest.get_connected_players()
|
function minetest.get_connected_players()
|
||||||
local temp_table = {}
|
local temp_table = {}
|
||||||
for index, value in pairs( player_list ) do
|
for index, value in pairs(player_list) do
|
||||||
table.insert( temp_table, value )
|
table.insert(temp_table, value)
|
||||||
end
|
end
|
||||||
return temp_table
|
return temp_table
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue