mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add ObjRef:is_player() and modify ObjRef:get_player_name() to always return a string to aid better inter-object compatibility of code that assumes objects to be players
This commit is contained in:
parent
b235e4d290
commit
bf8cfce50e
3 changed files with 13 additions and 3 deletions
|
@ -44,7 +44,7 @@ function minetest.get_connected_players()
|
|||
-- This could be optimized a bit, but leave that for later
|
||||
local list = {}
|
||||
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 obj:is_player() then
|
||||
table.insert(list, obj)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue