diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-30 13:45:51 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-30 13:45:51 +0300 |
commit | 80a64341f0f2ab0ae418fdf313c9a9f04c0f8047 (patch) | |
tree | c8bb6f8cb5fed59e8ad931e907b4ee1ceee3ced9 /games/minimal/mods/experimental | |
parent | bbf3eebb1adc50a54b26541b1445204a88776795 (diff) | |
download | minetest-80a64341f0f2ab0ae418fdf313c9a9f04c0f8047.tar.gz minetest-80a64341f0f2ab0ae418fdf313c9a9f04c0f8047.tar.bz2 minetest-80a64341f0f2ab0ae418fdf313c9a9f04c0f8047.zip |
Add minetest.get_connected_players()
Diffstat (limited to 'games/minimal/mods/experimental')
-rw-r--r-- | games/minimal/mods/experimental/init.lua | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/games/minimal/mods/experimental/init.lua b/games/minimal/mods/experimental/init.lua index f1b8ec44a..55ea64132 100644 --- a/games/minimal/mods/experimental/init.lua +++ b/games/minimal/mods/experimental/init.lua @@ -8,13 +8,11 @@ experimental = {} experimental.player_visual_index = 0 function switch_player_visual() - for _, obj in pairs(minetest.env:get_objects_inside_radius({x=0,y=0,z=0}, 1000000)) do - if obj:get_player_name() then - if experimental.player_visual_index == 0 then - obj:set_properties({visual="upright_sprite"}) - else - obj:set_properties({visual="cube"}) - end + for _, obj in pairs(minetest.get_connected_players()) do + if experimental.player_visual_index == 0 then + obj:set_properties({visual="upright_sprite"}) + else + obj:set_properties({visual="cube"}) end end experimental.player_visual_index = (experimental.player_visual_index + 1) % 2 |